public function testSetTitleSeparator() { Tag::setTitle('Title'); Tag::appendTitle('Class'); $this->assertEquals(Tag::getTitle(), '<title>TitleClass</title>' . PHP_EOL); Tag::setTitle('Title'); Tag::setTitleSeparator('|'); Tag::appendTitle('Class'); $this->assertEquals(Tag::getTitle(), '<title>Title|Class</title>' . PHP_EOL); $this->assertEquals(Tag::getTitleSeparator(), '|'); Tag::setTitle('Title'); Tag::setTitleSeparator('|'); Tag::prependTitle('Class'); $this->assertEquals(Tag::getTitle(), '<title>Class|Title</title>' . PHP_EOL); }
public function initialize() { $this->view->setTemplateAfter('main'); Tag::setTitle('财途网'); Tag::setTitleSeparator(' - '); $this->_initLibrary(); $this->_initSiteConfig(); $this->_initParams(); $this->_initMenu(); $actionName = $this->dispatcher->getActionName(); $controllName = $this->dispatcher->getHandlerClass(); $dispatcher = $controllName . '-' . $actionName; $this->_initPageTitle($dispatcher); $this->_initMetaData($dispatcher); $this->view->setVar("server", $_SERVER); $this->view->setVar("bdtongji", true); }
public static function setTitleSeparator($titleSeparator) { parent::setTitleSeparator($titleSeparator); }
}); /** * If the configuration specify the use of metadata adapter use it or use memory otherwise */ $di->set('modelsMetadata', function () { return new MetaData(); }); /** * Start the session the first time some component request the session service */ $di->set('session', function () { $session = new SessionAdapter(); $session->start(); return $session; }); /** * Register the flash service with custom CSS classes */ $di->set('flash', function () { return new FlashSession(array('error' => 'alert alert-danger', 'success' => 'alert alert-success', 'notice' => 'alert alert-info')); }); /** * Register a user component */ $di->set('helpers', function () { return new Helpers(); }); $di->set('tag', function () { Tag::setTitleSeparator(" | "); return new Tag(); });