PHP Class Symfony\Bridge\Twig\Form\TwigRendererEngine

Author: Bernhard Schussek ([email protected])
Inheritance: extends Symfony\Component\Form\AbstractRendererEngine, implements Symfony\Bridge\Twig\Form\TwigRendererEngineInterface
Afficher le fichier Open project: symfony/symfony Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( array $defaultThemes = [], Twig_Environment $environment = null )
renderBlock ( Symfony\Component\Form\FormView $view, $resource, $blockName, array $variables = [] )
setEnvironment ( Twig_Environment $environment )

Méthodes protégées

Méthode Description
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.

Method Details

__construct() public méthode

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

loadResourceForBlockName() protected méthode

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.
See also: 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
Résultat boolean True if the resource could be loaded, false otherwise

loadResourcesFromTheme() protected méthode

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 méthode

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

setEnvironment() public méthode

Deprecation: since version 3.3, to be removed in 4.0
public setEnvironment ( Twig_Environment $environment )
$environment Twig_Environment