本文整理汇总了PHP中Phalcon\Tag::appendTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::appendTitle方法的具体用法?PHP Tag::appendTitle怎么用?PHP Tag::appendTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phalcon\Tag
的用法示例。
在下文中一共展示了Tag::appendTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loginAction
/**
* Starts a session in the admin backend
*/
public function loginAction()
{
\Phalcon\Tag::appendTitle(" - Вход");
$form = new LoginForm();
try {
if (!$this->request->isPost()) {
if ($this->auth->hasRememberMe()) {
return $this->auth->loginWithRememberMe();
}
} else {
if ($form->isValid($this->request->getPost()) == false) {
foreach ($form->getMessages() as $message) {
$this->flash->error($message);
}
} else {
$this->auth->check(array('email' => $this->request->getPost('email', 'email'), 'password' => $this->request->getPost('password'), 'remember' => $this->request->getPost('remember')));
$auth = $this->session->get('auth');
$this->flashSession->notice($auth['role']);
if (!$auth) {
$this->flashSession->notice("Нужно войти или зарегистрироваться");
return $this->response->redirect("session/login");
}
if ($auth['role'] == 'Administrators') {
$this->flashSession->success("Здравствуйте администратор. Вы находитесь в области управления сайтом, в разделе Новости.");
return $this->response->redirect("backend/news");
}
return $this->response->redirect();
}
}
} catch (AuthException $e) {
$this->flash->error($e->getMessage());
}
$this->view->form = $form;
}
示例2: testSetTitleSeparator
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);
}
示例3: appendTitle
public static function appendTitle($title)
{
parent::appendTitle($title);
}
示例4: testAppendTitle
/**
* Tests appendTitle
*
* @author Nikos Dimopoulos <nikos@phalconphp.com>
* @since 2012-09-05
*/
public function testAppendTitle()
{
$value = 'This is my title';
\Phalcon\Tag::setTitle($value);
$append = ' - Welcome!';
\Phalcon\Tag::appendTitle($append);
$expected = "<title>{$value}{$append}</title>" . PHP_EOL;
$actual = \Phalcon\Tag::getTitle();
$this->assertEquals($expected, $actual, sprintf($this->message, 'appendTitle'));
}