Posted By

evinweissenberg on 08/22/12


Tagged

php copyright


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

patilraj21


Copyright Display


 / Published in: PHP
 

URL: http://www.evinw.com

Display Copyright

  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();

Report this snippet  

You need to login to post a comment.