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.

35 lines
728 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. * @version SVN: $Id$
  9. * @filesource $URL$
  10. */
  11. class TitleViewHelper extends ViewHelper
  12. {
  13. protected $separator = ' - ';
  14. public function title($string = false)
  15. {
  16. if ($string) {
  17. $data = Registry::get(__CLASS__, array());
  18. $data[] = $string;
  19. Registry::set(__CLASS__, $data);
  20. }
  21. return $this;
  22. }
  23. public function setSeparator($sep)
  24. {
  25. $this->separator = $sep;
  26. }
  27. public function __toString()
  28. {
  29. return implode($this->separator, Registry::get(__CLASS__, array()));
  30. }
  31. }