Skip to content

Commit f470441

Browse files
committed
Merge pull request symfony#2705 from WouterJ/issue_2703
Updated doc for the new way to render partials
2 parents e02e64b + 5f8b834 commit f470441

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cookbook/templating/PHP.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ below renders the ``index.html.php`` template::
5252
// src/Acme/HelloBundle/Controller/HelloController.php
5353

5454
// ...
55-
5655
public function indexAction($name)
5756
{
5857
return $this->render('AcmeHelloBundle:Hello:index.html.php', array('name' => $name));
@@ -226,10 +225,12 @@ If you create a ``fancy`` action, and want to include it into the
226225
.. code-block:: html+php
227226

228227
<!-- src/Acme/HelloBundle/Resources/views/Hello/index.html.php -->
229-
<?php echo $view['actions']->render('AcmeHelloBundle:Hello:fancy', array(
230-
'name' => $name,
231-
'color' => 'green'
232-
)) ?>
228+
<?php echo $view['actions']->render(
229+
new ControllerReference('AcmeHelloBundle:Hello:fancy', array(
230+
'name' => $name,
231+
'color' => 'green',
232+
))
233+
) ?>
233234

234235
Here, the ``AcmeHelloBundle:Hello:fancy`` string refers to the ``fancy`` action of the
235236
``Hello`` controller::

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy