Skip to content

Commit 6d458d8

Browse files
committed
minor #5781 Added annotations example to Linking to Pages examples (carlos-granados)
This PR was merged into the 2.3 branch. Discussion ---------- 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 Commits ------- 43f751e Added missing namespace statements 5941b89 Remove indentation in blank line 05da696 Added missing use statements 30e0dd4 Added annotations example to Linking to Pages examples
2 parents 8b85020 + 43f751e commit 6d458d8

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

book/templating.rst

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

868868
.. configuration-block::
869869

870+
.. code-block:: php-annotations
871+
872+
// src/AppBundle/Controller/WelcomeController.php
873+
namespace AppBundle\Controller;
874+
875+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
876+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
877+
878+
class WelcomeController extends Controller
879+
{
880+
/**
881+
* @Route("/", name="_welcome")
882+
*/
883+
public function indexAction()
884+
{
885+
// ...
886+
}
887+
}
888+
870889
.. code-block:: yaml
871890
872891
# app/config/routing.yml
@@ -918,6 +937,25 @@ route:
918937

919938
.. configuration-block::
920939

940+
.. code-block:: php-annotations
941+
942+
// src/AppBundle/Controller/ArticleController.php
943+
namespace AppBundle\Controller;
944+
945+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
946+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
947+
948+
class ArticleController extends Controller
949+
{
950+
/**
951+
* @Route("/article/{slug}", name="article_show")
952+
*/
953+
public function showAction($slug)
954+
{
955+
// ...
956+
}
957+
}
958+
921959
.. code-block:: yaml
922960
923961
# app/config/routing.yml

0 commit comments

Comments
 (0)