From 420d411f102517184304ef48c25fba9f0c86da2b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 7 Nov 2014 16:54:49 +0100 Subject: [PATCH] tweaks to the Twig reference --- reference/twig_reference.rst | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/reference/twig_reference.rst b/reference/twig_reference.rst index 64a63f2064c..d9ac5c386a8 100644 --- a/reference/twig_reference.rst +++ b/reference/twig_reference.rst @@ -7,15 +7,19 @@ Symfony Twig Extensions ======================= Twig is the default template engine for Symfony. By itself, it already contains -a lot of built-in functions, filters, tags and tests (`http://twig.sensiolabs.org/documentation`_ -then scroll to the bottom). +a lot of built-in functions, filters, tags and tests (learn more about them +from the the `Twig Reference`_). -Symfony 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 Symfony Core Framework. +Symfony adds more custom extensions on top of Twig to integrate some components +into the Twig templates. You can find more information about the custom +:ref:`functions `, :ref:`filters `, +:ref:`tags ` and :ref:`tests ` +that are added when using the Symfony Core Framework. There may also be tags in bundles you use that aren't listed here. +.. _reference-twig-functions: + Functions --------- @@ -40,7 +44,7 @@ render Renders the fragment for the given controller (using the `controller`_ function) or URI. For more information, see :ref:`templating-embedding-controller`. -The render strategy can be specified in the ``strategy`` key of the options. +The render strategy can be specified in the ``strategy`` key of the options. .. tip:: @@ -65,7 +69,7 @@ Generates an ESI tag when possible or falls back to the behaviour of .. tip:: The URI can be generated by other functions, like `path`_ and `url`_. - + .. tip:: The ``render_esi()`` function is an example of the shortcut functions @@ -354,6 +358,8 @@ Returns the absolute URL (with scheme and host) for the given route. If ``schemeRelative`` is enabled, it'll create a scheme-relative URL. More information in :ref:`book-templating-pages`. +.. _reference-twig-filters: + Filters ------- @@ -554,6 +560,8 @@ file_link Generates a link to the provided file (and optionally line number) using a preconfigured scheme. +.. _reference-twig-tags: + Tags ---- @@ -620,6 +628,8 @@ trans_default_domain This will set the default domain in the current template. +.. _reference-twig-tests: + Tests ----- @@ -669,5 +679,5 @@ Those bundles can have other Twig extensions: ``{% image %}`` tags. You can read more about them in :doc:`the Assetic Documentation `. +.. _`Twig Reference`: http://twig.sensiolabs.org/documentation#reference .. _`the official Twig Extensions documentation`: http://twig.sensiolabs.org/doc/extensions/index.html -.. _`http://twig.sensiolabs.org/documentation`: http://twig.sensiolabs.org/documentation