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

Added documentation for hinclude default templates #2021

merged 1 commit into from
Dec 18, 2012

Conversation

pierredup
Copy link
Contributor

Added documentation for symfony/symfony#5993


.. code-block:: php

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

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',
            )
        ) ?>

@pierredup
Copy link
Contributor Author

@wouterj Thanks, I have updated the commit.

fabpot added a commit to symfony/symfony that referenced this pull request Dec 14, 2012
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
fabpot added a commit to symfony/framework-bundle that referenced this pull request Dec 14, 2012
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
weaverryan added a commit that referenced this pull request Dec 18, 2012
Added documentation for hinclude default templates
@weaverryan weaverryan merged commit e68596a into symfony:master Dec 18, 2012
weaverryan added a commit that referenced this pull request Dec 18, 2012
@weaverryan
Copy link
Member

Hi Pierre!

This is very nice - great PR! Merged with very very minimal changes.

Thanks!

fabpot added a commit to symfony/framework-bundle that referenced this pull request Nov 11, 2014
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants