예제 #1
0
 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);
 }
예제 #2
0
 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);
 }
예제 #3
0
파일: Tag.php 프로젝트: mattvb91/cphalcon
 public static function setTitleSeparator($titleSeparator)
 {
     parent::setTitleSeparator($titleSeparator);
 }
예제 #4
0
});
/**
 * 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();
});