Skip to content

Commit

Permalink
minor #4432 [Reference][Twig] tweaks to the Twig reference (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

[Reference][Twig] tweaks to the Twig reference

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets |

Commits
-------

420d411 tweaks to the Twig reference
  • Loading branch information
weaverryan committed Nov 20, 2014
2 parents 188dd1f + 420d411 commit 3969fd6
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions reference/twig_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <reference-twig-functions>`, :ref:`filters <reference-twig-filters>`,
:ref:`tags <reference-twig-tags>` and :ref:`tests <reference-twig-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
---------

Expand All @@ -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::

Expand All @@ -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
Expand Down Expand Up @@ -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
-------

Expand Down Expand Up @@ -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
----

Expand Down Expand Up @@ -620,6 +628,8 @@ trans_default_domain

This will set the default domain in the current template.

.. _reference-twig-tests:

Tests
-----

Expand Down Expand Up @@ -669,5 +679,5 @@ Those bundles can have other Twig extensions:
``{% image %}`` tags. You can read more about them in
:doc:`the Assetic Documentation </cookbook/assetic/asset_management>`.

.. _`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

0 comments on commit 3969fd6

Please sign in to comment.