Skip to content

Commit 9697d70

Browse files
authored
Update controller syntax for bundle-less applications
1 parent 2c34fcb commit 9697d70

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

templating/embedding_controllers.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ The ``recent_list`` template is perfectly straightforward:
6767
(e.g. ``/article/*slug*``). This is a bad practice. In the next section,
6868
you'll learn how to do this correctly.
6969

70-
To include the controller, you'll need to refer to it using the standard
71-
string syntax for controllers (i.e. **bundle**:**controller**:**action**):
70+
To include the controller, you'll need to refer to it using the standard string syntax for controllers (i.e. **controllerPath**:**action**).
71+
72+
Where controllerPath is a Full Qualified Class Name. (Notice double ``\\`` as a directory separator) and action is method in controller without the action postfix.
7273

7374
.. configuration-block::
7475

@@ -79,7 +80,7 @@ string syntax for controllers (i.e. **bundle**:**controller**:**action**):
7980
{# ... #}
8081
<div id="sidebar">
8182
{{ render(controller(
82-
'AppBundle:Article:recentArticles',
83+
'App\\Controller\\ArticleController:recentArticles',
8384
{ 'max': 3 }
8485
)) }}
8586
</div>
@@ -92,7 +93,7 @@ string syntax for controllers (i.e. **bundle**:**controller**:**action**):
9293
<div id="sidebar">
9394
<?php echo $view['actions']->render(
9495
new \Symfony\Component\HttpKernel\Controller\ControllerReference(
95-
'AppBundle:Article:recentArticles',
96+
'App\\Controller\\ArticleController:recentArticles',
9697
array('max' => 3)
9798
)
9899
) ?>

0 commit comments

Comments
 (0)