Files
majestic/View/Helpers/TitleViewHelper.php

34 lines
745 B
PHP
Raw Normal View History

2014-06-02 18:58:49 +04:00
<?php namespace Majestic\View\Helpers;
/**
* @copyright NetMonsters <team@netmonsters.ru>
* @link http://netmonsters.ru
* @package Majestic
* @subpackage View
* @since 2010-03-16
*/
class TitleViewHelper extends ViewHelper
{
2012-11-21 15:43:20 +04:00
protected $separator = ' - ';
2012-11-21 15:43:20 +04:00
public function title($string = false)
{
if ($string) {
2014-06-02 18:58:49 +04:00
$data = \Majestic\Registry::get(__CLASS__, array());
$data[] = $string;
2014-06-02 18:58:49 +04:00
\Majestic\Registry::set(__CLASS__, $data);
}
return $this;
}
2012-11-21 15:43:20 +04:00
public function setSeparator($sep)
{
$this->separator = $sep;
}
2012-11-21 15:43:20 +04:00
public function __toString()
{
2014-06-02 18:58:49 +04:00
return implode($this->separator, \Majestic\Registry::get(__CLASS__, array()));
}
}