Spec-Zone.ru › Symfony 3.1

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.1/Symfony/Bundle/TwigBundle/Debug/TimedTwigEngine.html

Spec-Zone.ru

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