PHP Класс Symfony\Bridge\Twig\Form\TwigRendererEngine

Автор: Bernhard Schussek ([email protected])
Наследование: extends Symfony\Component\Form\AbstractRendererEngine, implements Symfony\Bridge\Twig\Form\TwigRendererEngineInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( array $defaultThemes = [], Twig_Environment $environment = null )
renderBlock ( Symfony\Component\Form\FormView $view, $resource, $blockName, array $variables = [] )
setEnvironment ( Twig_Environment $environment )

Защищенные методы

Метод Описание
loadResourceForBlockName ( string $cacheKey, Symfony\Component\Form\FormView $view, string $blockName ) : boolean Loads the cache with the resource for a given block name.
loadResourcesFromTheme ( string $cacheKey, mixed &$theme ) Loads the resources for all blocks in a theme.

Описание методов

__construct() публичный Метод

public __construct ( array $defaultThemes = [], Twig_Environment $environment = null )
$defaultThemes array
$environment Twig_Environment

loadResourceForBlockName() защищенный Метод

This implementation eagerly loads all blocks of the themes assigned to the given view and all of its ancestors views. This is necessary, because Twig receives the list of blocks later. At that point, all blocks must already be loaded, for the case that the function "block()" is used in the Twig template.
См. также: getResourceForBlock()
protected loadResourceForBlockName ( string $cacheKey, Symfony\Component\Form\FormView $view, string $blockName ) : boolean
$cacheKey string The cache key of the form view
$view Symfony\Component\Form\FormView The form view for finding the applying themes
$blockName string The name of the block to load
Результат boolean True if the resource could be loaded, false otherwise

loadResourcesFromTheme() защищенный Метод

Loads the resources for all blocks in a theme.
protected loadResourcesFromTheme ( string $cacheKey, mixed &$theme )
$cacheKey string The cache key for storing the resource
$theme mixed The theme to load the block from. This parameter is passed by reference, because it might be necessary to initialize the theme first. Any changes made to this variable will be kept and be available upon further calls to this method using the same theme.

renderBlock() публичный Метод

public renderBlock ( Symfony\Component\Form\FormView $view, $resource, $blockName, array $variables = [] )
$view Symfony\Component\Form\FormView
$variables array

setEnvironment() публичный Метод

Устаревший: since version 3.3, to be removed in 4.0
public setEnvironment ( Twig_Environment $environment )
$environment Twig_Environment