Skip to content

Commit 30e0dd4

Browse files
author
Carlos Granados
committed
Added annotations example to Linking to Pages examples
In the routing examples for the Linking to Pages section there were no annotations examples (which is what most people use). I have added these examples
1 parent 9926e03 commit 30e0dd4

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

book/templating.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,20 @@ configuration:
867867

868868
.. configuration-block::
869869

870+
.. code-block:: php-annotations
871+
872+
// src/AppBundle/Controller/WelcomeController.php
873+
class WelcomeController extends Controller
874+
{
875+
/**
876+
* @Route("/", name="_welcome")
877+
*/
878+
public function indexAction()
879+
{
880+
// ...
881+
}
882+
}
883+
870884
.. code-block:: yaml
871885
872886
# app/config/routing.yml
@@ -918,6 +932,20 @@ route:
918932

919933
.. configuration-block::
920934

935+
.. code-block:: php-annotations
936+
937+
// src/AppBundle/Controller/ArticleController.php
938+
class ArticleController extends Controller
939+
{
940+
/**
941+
* @Route("/article/{slug}", name="article_show")
942+
*/
943+
public function showAction($slug)
944+
{
945+
// ...
946+
}
947+
}
948+
921949
.. code-block:: yaml
922950
923951
# app/config/routing.yml

0 commit comments

Comments
 (0)