You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
685 B

  1. <?php
  2. /**
  3. * @copyright NetMonsters <team@netmonsters.ru>
  4. * @link http://netmonsters.ru
  5. * @package Majestic
  6. * @subpackage View
  7. * @since 2010-03-16
  8. */
  9. class TitleViewHelper extends ViewHelper
  10. {
  11. protected $separator = ' - ';
  12. public function title($string = false)
  13. {
  14. if ($string) {
  15. $data = Registry::get(__CLASS__, array());
  16. $data[] = $string;
  17. Registry::set(__CLASS__, $data);
  18. }
  19. return $this;
  20. }
  21. public function setSeparator($sep)
  22. {
  23. $this->separator = $sep;
  24. }
  25. public function __toString()
  26. {
  27. return implode($this->separator, Registry::get(__CLASS__, array()));
  28. }
  29. }