Created
November 6, 2012 10:33
-
-
Save serapheem/4023928 to your computer and use it in GitHub Desktop.
Symfony2 - Render controller action from template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Twig: | |
{# app/Resources/views/base.html.twig #} | |
{# ... #} | |
<div id="sidebar"> | |
{% render "AcmeArticleBundle:Article:recentArticles" with {'max': 3} %} | |
</div> | |
PHP: | |
<!-- app/Resources/views/base.html.php --> | |
{# ... #} | |
<div id="sidebar"> | |
<?php echo $view['actions']->render('AcmeArticleBundle:Article:recentArticles', array('max' => 3)) ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment