本文整理汇总了PHP中Phalcon\Tag::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::getTitle方法的具体用法?PHP Tag::getTitle怎么用?PHP Tag::getTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phalcon\Tag
的用法示例。
在下文中一共展示了Tag::getTitle方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registryFunctions
/**
* Registers common function in Twig
*
* @param \Phalcon\Mvc\ViewInterface $view
* @param \Phalcon\DiInterface $di
* @param array $userFunctions
*/
protected function registryFunctions($view, DiInterface $di, $userFunctions = array())
{
$options = array('is_safe' => array('html'));
$functions = array(new \Twig_SimpleFunction('content', function () use($view) {
return $view->getContent();
}, $options), new \Twig_SimpleFunction('partial', function ($partialPath) use($view) {
return $view->partial($partialPath);
}, $options), new \Twig_SimpleFunction('linkTo', function ($parameters, $text = null) {
return \Phalcon\Tag::linkTo($parameters, $text);
}, $options), new \Twig_SimpleFunction('textField', function ($parameters) {
return \Phalcon\Tag::textField($parameters);
}, $options), new \Twig_SimpleFunction('passwordField', function ($parameters) {
return \Phalcon\Tag::passwordField($parameters);
}, $options), new \Twig_SimpleFunction('hiddenField', function ($parameters) {
return \Phalcon\Tag::hiddenField($parameters);
}, $options), new \Twig_SimpleFunction('fileField', function ($parameters) {
return \Phalcon\Tag::fileField($parameters);
}, $options), new \Twig_SimpleFunction('checkField', function ($parameters) {
return \Phalcon\Tag::checkField($parameters);
}, $options), new \Twig_SimpleFunction('radioField', function ($parameters) {
return \Phalcon\Tag::radioField($parameters);
}, $options), new \Twig_SimpleFunction('submitButton', function ($parameters) {
return \Phalcon\Tag::submitButton($parameters);
}, $options), new \Twig_SimpleFunction('selectStatic', function ($parameters, $data = array()) {
return \Phalcon\Tag::selectStatic($parameters, $data);
}, $options), new \Twig_SimpleFunction('select', function ($parameters, $data = array()) {
return \Phalcon\Tag::select($parameters, $data);
}, $options), new \Twig_SimpleFunction('textArea', function ($parameters) {
return \Phalcon\Tag::textArea($parameters);
}, $options), new \Twig_SimpleFunction('form', function ($parameters = array()) {
return \Phalcon\Tag::form($parameters);
}, $options), new \Twig_SimpleFunction('endForm', function () {
return \Phalcon\Tag::endForm();
}, $options), new \Twig_SimpleFunction('getTitle', function () {
return \Phalcon\Tag::getTitle();
}, $options), new \Twig_SimpleFunction('stylesheetLink', function ($parameters = null, $local = true) {
return \Phalcon\Tag::stylesheetLink($parameters, $local);
}, $options), new \Twig_SimpleFunction('javascriptInclude', function ($parameters = null, $local = true) {
return \Phalcon\Tag::javascriptInclude($parameters, $local);
}, $options), new \Twig_SimpleFunction('image', function ($parameters) {
return \Phalcon\Tag::image($parameters);
}, $options), new \Twig_SimpleFunction('friendlyTitle', function ($text, $separator = null, $lowercase = true) {
return \Phalcon\Tag::friendlyTitle($text, $separator, $lowercase);
}, $options), new \Twig_SimpleFunction('getDocType', function () {
return \Phalcon\Tag::getDocType();
}, $options), new \Twig_SimpleFunction('getSecurityToken', function () use($di) {
return $di->get("security")->getToken();
}, $options), new \Twig_SimpleFunction('getSecurityTokenKey', function () use($di) {
return $di->get("security")->getTokenKey();
}, $options), new \Twig_SimpleFunction('url', function ($route) use($di) {
return $di->get("url")->get($route);
}, $options));
if (!empty($userFunctions)) {
$functions = array_merge($functions, $userFunctions);
}
foreach ($functions as $function) {
$this->twig->addFunction($function);
}
}
示例2: registryFunctions
/**
* Registers common function in Twig
*
* @param \Phalcon\Mvc\ViewInterface $view
*/
private function registryFunctions($view)
{
$options = array('is_safe' => array('html'));
$functions = array(new \Twig_SimpleFunction('content', function () use($view) {
return $view->getContent();
}, $options), new \Twig_SimpleFunction('partial', function ($partialPath) use($view) {
return $view->partial($partialPath);
}, $options), new \Twig_SimpleFunction('linkTo', function ($parameters, $text = null) {
return \Phalcon\Tag::linkTo($parameters, $text);
}, $options), new \Twig_SimpleFunction('textField', function ($parameters) {
return \Phalcon\Tag::textField($parameters);
}, $options), new \Twig_SimpleFunction('passwordField', function ($parameters) {
return \Phalcon\Tag::passwordField($parameters);
}, $options), new \Twig_SimpleFunction('hiddenField', function ($parameters) {
return \Phalcon\Tag::hiddenField($parameters);
}, $options), new \Twig_SimpleFunction('fileField', function ($parameters) {
return \Phalcon\Tag::fileField($parameters);
}, $options), new \Twig_SimpleFunction('checkField', function ($parameters) {
return \Phalcon\Tag::checkField($parameters);
}, $options), new \Twig_SimpleFunction('radioField', function ($parameters) {
return \Phalcon\Tag::radioField($parameters);
}, $options), new \Twig_SimpleFunction('submitButton', function ($parameters) {
return \Phalcon\Tag::submitButton($parameters);
}, $options), new \Twig_SimpleFunction('selectStatic', function ($parameters, $data = []) {
return \Phalcon\Tag::selectStatic($parameters, $data);
}, $options), new \Twig_SimpleFunction('select', function ($parameters, $data = []) {
return \Phalcon\Tag::select($parameters, $data);
}, $options), new \Twig_SimpleFunction('textArea', function ($parameters) {
return \Phalcon\Tag::textArea($parameters);
}, $options), new \Twig_SimpleFunction('form', function ($parameters = []) {
return \Phalcon\Tag::form($parameters);
}, $options), new \Twig_SimpleFunction('endForm', function () {
return \Phalcon\Tag::endForm();
}, $options), new \Twig_SimpleFunction('getTitle', function () {
return \Phalcon\Tag::getTitle();
}, $options), new \Twig_SimpleFunction('getTitle', function () {
return \Phalcon\Tag::getTitle();
}, $options), new \Twig_SimpleFunction('stylesheetLink', function ($parameters = null, $local = true) {
return \Phalcon\Tag::stylesheetLink($parameters, $local);
}, $options), new \Twig_SimpleFunction('javascriptInclude', function ($parameters = null, $local = true) {
return \Phalcon\Tag::javascriptInclude($parameters, $local);
}, $options), new \Twig_SimpleFunction('image', function ($parameters) {
return \Phalcon\Tag::image($parameters);
}, $options), new \Twig_SimpleFunction('friendlyTitle', function ($text, $separator = null, $lowercase = true) {
return \Phalcon\Tag::friendlyTitle($text, $separator, $lowercase);
}, $options), new \Twig_SimpleFunction('getDocType', function () {
return \Phalcon\Tag::getDocType();
}, $options));
foreach ($functions as $function) {
$this->_twig->addFunction($function);
}
}
示例3: 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);
}
示例4:
<html>
<head>
<?php
echo \Phalcon\Tag::getTitle();
?>
</head>
<body>
</body>
</html>
示例5: getTitle
public static function getTitle($tags = true)
{
return parent::getTitle($tags);
}
示例6: testPrependTitle
/**
* Tests prependTitle
*
* @author Nikos Dimopoulos <nikos@phalconphp.com>
* @since 2012-09-05
*/
public function testPrependTitle()
{
$value = 'This is my title';
\Phalcon\Tag::setTitle($value);
$prepend = 'PhalconPHP -';
\Phalcon\Tag::prependTitle($prepend);
$expected = "<title>{$prepend}{$value}</title>" . PHP_EOL;
$actual = \Phalcon\Tag::getTitle();
$this->assertEquals($expected, $actual, sprintf($this->message, 'prependTitle'));
}
示例7:
<?php
use Phalcon\Tag;
?>
<!DOCTYPE html>
<html>
<head>
<?php
echo Tag::getTitle();
?>
</head>
<!-- ... -->
</html>