Spec-Zone.ru › Symfony 3.0

TimedTwigEngine deprecated

class TimedTwigEngine extends TwigEngine

deprecated

since version 2.7, to be removed in 3.0. Use the Twig native profiler instead.

Замеряет время, затраченное на отображение шаблона.

Methods

__construct(Twig_Environment $environment, TemplateNameParserInterface $parser, FileLocatorInterface $locator, Stopwatch $stopwatch)

Конструктор.

string render(string|TemplateReferenceInterface $name, array $parameters = array())

Отображает шаблон.

stream(string|TemplateReferenceInterface $name, array $parameters = array())

Выводит шаблон в поток.

from TwigEngine
bool exists(string|TemplateReferenceInterface $name)

Возвращает true, если шаблон существует.

from TwigEngine
bool supports(string|TemplateReferenceInterface $name)

Возвращает true, если данный класс может отобразить указанный шаблон.

from TwigEngine
setDefaultEscapingStrategy($strategy) deprecated from TwigEngine
guessDefaultEscapingStrategy($filename) deprecated from TwigEngine
Response renderResponse(string $view, array $parameters = array(), Response $response = null)

Отображает представление и возвращает объект Response.

from TwigEngine

Details

__construct(Twig_Environment $environment, TemplateNameParserInterface $parser, FileLocatorInterface $locator, Stopwatch $stopwatch)

Конструктор.

Parameters

Twig_Environment $environment Объект \Twig_Environment
TemplateNameParserInterface $parser Объект TemplateNameParserInterface
FileLocatorInterface $locator Объект FileLocatorInterface
Stopwatch $stopwatch Объект Stopwatch

string render(string|TemplateReferenceInterface $name, array $parameters = array())

Отображает шаблон.

Parameters

string|TemplateReferenceInterface $name Имя шаблона или объект TemplateReferenceInterface
array $parameters Массив параметров, передаваемых шаблону

Return Value

string Отображенный шаблон в виде строки

Exceptions

RuntimeException если шаблон не может быть отображен

stream(string|TemplateReferenceInterface $name, array $parameters = array())

Выводит шаблон в поток.

Реализация должна выводить содержимое непосредственно в браузер.

Parameters

string|TemplateReferenceInterface $name Имя шаблона или объект TemplateReferenceInterface
array $parameters Массив параметров, передаваемых шаблону

Exceptions

RuntimeException если шаблон не может быть отображен
LogicException если шаблон не может быть выведен в поток

bool exists(string|TemplateReferenceInterface $name)

Возвращает true, если шаблон существует.

Parameters

string|TemplateReferenceInterface $name Имя шаблона или объект TemplateReferenceInterface

Return Value

bool true, если шаблон существует, иначе false

Exceptions

RuntimeException если движок не может обработать имя шаблона

bool supports(string|TemplateReferenceInterface $name)

Возвращает true, если данный класс может отобразить указанный шаблон.

Parameters

string|TemplateReferenceInterface $name Имя шаблона или объект TemplateReferenceInterface

Return Value

bool true, если класс поддерживает указанный шаблон, иначе false

setDefaultEscapingStrategy($strategy) deprecated

deprecated

since version 2.7, to be removed in 3.0. Inject the escaping strategy on \Twig_Environment instead.

Parameters

$strategy

guessDefaultEscapingStrategy($filename) deprecated

deprecated

since version 2.7, to be removed in 3.0. Use the 'filename' strategy instead.

Parameters

$filename

Response renderResponse(string $view, array $parameters = array(), Response $response = null)

Отображает представление и возвращает объект Response.

Parameters

string $view Имя представления
array $parameters Массив параметров, передаваемых представлению
Response $response Объект Response

Return Value

Response Объект Response

Exceptions

RuntimeException если шаблон не может быть отображен

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Bundle/TwigBundle/Debug/TimedTwigEngine.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API