-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Conversation
|
||
.. code-block:: php | ||
|
||
<?php echo $view['actions']->render('...:news', array(), array('standalone' => 'js', 'default' => 'AcmeDemoBundle:Default:content.html.twig')) ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer to break code examples onto multiple lines if it reaches the 80 character (a longer line will produce horizontal scrollbars). You should do something like:
.. 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',
)
) ?>
@wouterj Thanks, I have updated the commit. |
This PR was merged into the master branch. Commits ------- 74a8fcf [FrameworkBundle] Added support for default templates per render tag Discussion ---------- [FrameworkBundle] Added support for default templates per render tag This commit allows you to specify default templates per render tag when using hinclude. E.G: The following will use the specific default template for the render: ```` {% render "AcmeDemoBundle:Controller:action" with {}, {"standalone" : "js", "default" : "AcmeDemoBundle:Default:content.html.twig"} %}```` or if you don't want to use a template for the default content but just a string, you can do the following ```` {% render "AcmeDemoBundle:Controller:action" with {}, {"standalone" : "js", "default" : "Loading..."} %}```` Bug fix: no Feature addition: yes Backwards compatibility break: no Fixes the following tickets: #3356 Todo: - Documentation --------------------------------------------------------------------------- by fabpot at 2012-12-14T12:25:40Z Looks good to me. Can you add a note in the CHANGELOG of the component and send a PR on symfony/symfony-docs about this new feature? Thanks. --------------------------------------------------------------------------- by pierredup at 2012-12-14T14:30:00Z @fabpot done, documentation PR symfony/symfony-docs#2021
This PR was merged into the master branch. Commits ------- 74a8fcf [FrameworkBundle] Added support for default templates per render tag Discussion ---------- [FrameworkBundle] Added support for default templates per render tag This commit allows you to specify default templates per render tag when using hinclude. E.G: The following will use the specific default template for the render: ```` {% render "AcmeDemoBundle:Controller:action" with {}, {"standalone" : "js", "default" : "AcmeDemoBundle:Default:content.html.twig"} %}```` or if you don't want to use a template for the default content but just a string, you can do the following ```` {% render "AcmeDemoBundle:Controller:action" with {}, {"standalone" : "js", "default" : "Loading..."} %}```` Bug fix: no Feature addition: yes Backwards compatibility break: no Fixes the following tickets: #3356 Todo: - Documentation --------------------------------------------------------------------------- by fabpot at 2012-12-14T12:25:40Z Looks good to me. Can you add a note in the CHANGELOG of the component and send a PR on symfony/symfony-docs about this new feature? Thanks. --------------------------------------------------------------------------- by pierredup at 2012-12-14T14:30:00Z @fabpot done, documentation PR symfony/symfony-docs#2021
Added documentation for hinclude default templates
Hi Pierre! This is very nice - great PR! Merged with very very minimal changes. Thanks! |
This PR was merged into the master branch. Commits ------- 74a8fcf [FrameworkBundle] Added support for default templates per render tag Discussion ---------- [FrameworkBundle] Added support for default templates per render tag This commit allows you to specify default templates per render tag when using hinclude. E.G: The following will use the specific default template for the render: ```` {% render "AcmeDemoBundle:Controller:action" with {}, {"standalone" : "js", "default" : "AcmeDemoBundle:Default:content.html.twig"} %}```` or if you don't want to use a template for the default content but just a string, you can do the following ```` {% render "AcmeDemoBundle:Controller:action" with {}, {"standalone" : "js", "default" : "Loading..."} %}```` Bug fix: no Feature addition: yes Backwards compatibility break: no Fixes the following tickets: #3356 Todo: - Documentation --------------------------------------------------------------------------- by fabpot at 2012-12-14T12:25:40Z Looks good to me. Can you add a note in the CHANGELOG of the component and send a PR on symfony/symfony-docs about this new feature? Thanks. --------------------------------------------------------------------------- by pierredup at 2012-12-14T14:30:00Z @fabpot done, documentation PR symfony/symfony-docs#2021
Added documentation for symfony/symfony#5993