TwigRendererInterface
interface TwigRendererInterface implements FormRendererInterface
Methods
Returns the engine used by this renderer.
Renders a named block of the form theme.
Searches and renders a block for a given name suffix.
Sets Twig's environment.
Details
in FormRendererInterface at line line 26
FormRendererEngineInterface
getEngine()
Returns the engine used by this renderer.
in FormRendererInterface at line line 35
setTheme(FormView $view, mixed $themes)
Sets the theme(s) to be used for rendering a view and its children.
in FormRendererInterface at line line 46
string
renderBlock(FormView $view, string $blockName, array $variables = array())
Renders a named block of the form theme.
in FormRendererInterface at line line 64
string
searchAndRenderBlock(FormView $view, string $blockNameSuffix, array $variables = array())
Searches and renders a block for a given name suffix.
The block is searched by combining the block names stored in the form view with the given suffix. If a block name is found, that block is rendered.
If this method is called recursively, the block search is continued where a block was found before.
in FormRendererInterface at line line 89
string
renderCsrfToken(string $intention)
Renders a CSRF token.
Use this helper for CSRF protection without the overhead of creating a form.
Check the token in your action using the same intention.
$csrfProvider = $this->get('form.csrfprovider');
if (!$csrfProvider->isCsrfTokenValid('rmuser_'.$user->getId(), $token)) {
throw new \RuntimeException('CSRF attack detected.');
}
in FormRendererInterface at line line 102
string
humanize(string $text)
Makes a technical name human readable.
Sequences of underscores are replaced by single spaces. The first letter of the resulting string is capitalized, while all other letters are turned to lowercase.
at line line 26
setEnvironment(Twig_Environment $environment)
Sets Twig's environment.