You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symfony2 adds more custom extension on top of Twig to integrate some components
into the Twig templates. Below is information about all the custom functions,
filters, tags and tests that are added when using the Symfony2 Core Framework.
There may also be tags in bundles you use that aren't listed here.
Functions
.. versionadded:: 2.1
The ``csrf_token``, ``logout_path`` and ``logout_url`` functions were added in Symfony2.1
This will transform the variable text into a YAML syntax.
variable|yaml_dump
This will render a yaml syntax with their type.
classname|abbr_class
This will render an abbr element with the short name of a
PHP class.
methodname|abbr_method
This will render a PHP method inside a abbr element
(e.g. Symfony\Component\HttpFoundation\Response::getContent
arguments|format_args
This will render a string with the arguments of a function and
their types.
arguments|format_args_as_text
Equal to [...]|format_args, but it strips the tags.
path|file_excerpt(line)
This will render an excerpt of a code file around the given line.
path|format_file(line, text = null)
This will render a file path in a link.
exceptionMessage|format_file_from_text
Equal to format_file except it parsed the default PHP error
string into a file path (i.e. 'in foo.php on line 45')
path|file_link(line)
This will render a path to the correct file (and line number)
Tags
Tag Syntax
Usage
{% render url('route', {parameters}) %}
This will render the Response Content for the given controller
that the URL points to. For more information,
see :ref:`templating-embedding-controller`.