Skip to content

Commit 079ee86

Browse files
committed
minor #8555 Update controller syntax for bundle-less applications (mimol91)
This PR was merged into the master branch. Discussion ---------- Update controller syntax for bundle-less applications Update information how to render controller action in bundle-less applications. Symfony 4 encourages to do not use bundles, thus why embedding controller action in twig is slightly different. `App\\Controller\\ArticleController:recentArticles` instead of 'bundle syntax' `AppBundle:Article:recentArticles` Commits ------- 480c1a6 Update controller syntax for bundle-less applications
2 parents f54e4ca + 480c1a6 commit 079ee86

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

templating/embedding_controllers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The ``recent_list`` template is perfectly straightforward:
6868
you'll learn how to do this correctly.
6969

7070
To include the controller, you'll need to refer to it using the standard
71-
string syntax for controllers (i.e. **bundle**:**controller**:**action**):
71+
string syntax for controllers (i.e. **controllerPath**::**action**):
7272

7373
.. configuration-block::
7474

@@ -79,7 +79,7 @@ string syntax for controllers (i.e. **bundle**:**controller**:**action**):
7979
{# ... #}
8080
<div id="sidebar">
8181
{{ render(controller(
82-
'AppBundle:Article:recentArticles',
82+
'App\\Controller\\ArticleController::recentArticles',
8383
{ 'max': 3 }
8484
)) }}
8585
</div>
@@ -92,7 +92,7 @@ string syntax for controllers (i.e. **bundle**:**controller**:**action**):
9292
<div id="sidebar">
9393
<?php echo $view['actions']->render(
9494
new \Symfony\Component\HttpKernel\Controller\ControllerReference(
95-
'AppBundle:Article:recentArticles',
95+
'App\\Controller\\ArticleController::recentArticles',
9696
array('max' => 3)
9797
)
9898
) ?>

0 commit comments

Comments
 (0)