Skip to content

Added documentation for hinclude default templates #2021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,53 @@ in your application configuration:
),
));

.. versionadded:: 2.2
Default templates per render tag was added in Symfony 2.2

You can define default templates per ``render`` tag (which will override any global default templates that is defined):

.. configuration-block::

.. code-block:: jinja

{% render '...:news' with
{},
{'standalone': 'js', 'default': 'AcmeDemoBundle:Default:content.html.twig'}
%}

.. code-block:: php

<?php echo $view['actions']->render(
'...:news',
array(),
array(
'standalone' => 'js',
'default' => 'AcmeDemoBundle:Default:content.html.twig',
)
) ?>

Or you can also specify a string to display as the default content:

.. configuration-block::

.. code-block:: jinja

{% render '...:news' with
{},
{'standalone': 'js', 'default': 'Loading...'}
%}

.. code-block:: php

<?php echo $view['actions']->render(
'...:news',
array(),
array(
'standalone' => 'js',
'default' => 'Loading...',
)
) ?>

.. index::
single: Templating; Linking to pages

Expand Down