From 30e0dd4462b95808135d4fc34444dea299319058 Mon Sep 17 00:00:00 2001 From: Carlos Granados Date: Mon, 12 Oct 2015 18:16:05 +0200 Subject: [PATCH 1/4] 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 --- book/templating.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/book/templating.rst b/book/templating.rst index 832192aad7e..c70cad9accb 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -867,6 +867,20 @@ configuration: .. configuration-block:: + .. code-block:: php-annotations + + // src/AppBundle/Controller/WelcomeController.php + class WelcomeController extends Controller + { + /** + * @Route("/", name="_welcome") + */ + public function indexAction() + { + // ... + } + } + .. code-block:: yaml # app/config/routing.yml @@ -918,6 +932,20 @@ route: .. configuration-block:: + .. code-block:: php-annotations + + // src/AppBundle/Controller/ArticleController.php + class ArticleController extends Controller + { + /** + * @Route("/article/{slug}", name="article_show") + */ + public function showAction($slug) + { + // ... + } + } + .. code-block:: yaml # app/config/routing.yml From 05da6960a8a9c50a3b7600b5569790bdfc651b02 Mon Sep 17 00:00:00 2001 From: Carlos Granados Date: Wed, 14 Oct 2015 16:53:04 +0200 Subject: [PATCH 2/4] Added missing use statements Added missing use statements for new annotations code example --- book/templating.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/book/templating.rst b/book/templating.rst index c70cad9accb..01f0307b3ff 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -870,6 +870,9 @@ configuration: .. code-block:: php-annotations // src/AppBundle/Controller/WelcomeController.php + use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; + class WelcomeController extends Controller { /** @@ -935,6 +938,9 @@ route: .. code-block:: php-annotations // src/AppBundle/Controller/ArticleController.php + use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; + class ArticleController extends Controller { /** From 5941b89dbfdd0d0e7ad402ce40d0e27b25e83473 Mon Sep 17 00:00:00 2001 From: Carlos Granados Date: Wed, 14 Oct 2015 16:59:01 +0200 Subject: [PATCH 3/4] Remove indentation in blank line Remove indentation in blank line --- book/templating.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/templating.rst b/book/templating.rst index 01f0307b3ff..51abc36b4ee 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -872,7 +872,7 @@ configuration: // src/AppBundle/Controller/WelcomeController.php use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - + class WelcomeController extends Controller { /** @@ -940,7 +940,7 @@ route: // src/AppBundle/Controller/ArticleController.php use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - + class ArticleController extends Controller { /** From 43f751e810f895f5b49dcf7f19addfcca07b7a6a Mon Sep 17 00:00:00 2001 From: Carlos Granados Date: Mon, 19 Oct 2015 12:17:06 +0200 Subject: [PATCH 4/4] Added missing namespace statements added the namespace statements to the annotation examples --- book/templating.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/book/templating.rst b/book/templating.rst index 51abc36b4ee..1370db8396b 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -870,6 +870,8 @@ configuration: .. code-block:: php-annotations // src/AppBundle/Controller/WelcomeController.php + namespace AppBundle\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; @@ -938,6 +940,8 @@ route: .. code-block:: php-annotations // src/AppBundle/Controller/ArticleController.php + namespace AppBundle\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;