Copyright Display


/ Published in: PHP
Save to your folder(s)

Display Copyright


Copy this code and paste it in your HTML
  1. <?php
  2. /*
  3. |---------------------------
  4. | Author: Evin Weissenberg
  5. |---------------------------
  6. */
  7. class Copyright_Display {
  8.  
  9. private $company_name;
  10. private $utf8;
  11.  
  12. function __constructor() {
  13.  
  14. $this->utf8 = ini_set('default_charset', 'UTF-8');
  15.  
  16. }
  17.  
  18. function setCompanyName($company_name) {
  19.  
  20. $this->company_name = (string)$company_name;
  21. return $this;
  22. }
  23.  
  24. function __get($property) {
  25.  
  26. return $this->$property;
  27.  
  28. }
  29.  
  30. function render() {
  31.  
  32. $copyright = "Copyright © " . date('Y') . " " . $this->company_name;
  33.  
  34. return $copyright;
  35.  
  36. }
  37.  
  38. function __destructor() {
  39.  
  40. unset($this->utf8);
  41.  
  42. }
  43. }
  44. $c = new Copyright_Display();
  45. $c->setCompanyName('ACME LLC')->render();

URL: http://www.evinw.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.