From 98c4525d49206c612499423690cf7a505df30f73 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Tue, 8 Dec 2015 09:52:59 +0100 Subject: [PATCH] [Book] Do not extend the base controller before introducing it --- book/page_creation.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/book/page_creation.rst b/book/page_creation.rst index c062182d5f8..7c940eef100 100644 --- a/book/page_creation.rst +++ b/book/page_creation.rst @@ -39,11 +39,10 @@ a method inside of it that will be executed when someone goes to ``/lucky/number // src/AppBundle/Controller/LuckyController.php namespace AppBundle\Controller; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Component\HttpFoundation\Response; - class LuckyController extends Controller + class LuckyController { /** * @Route("/lucky/number") @@ -104,7 +103,7 @@ Just add a second method to ``LuckyController``:: // src/AppBundle/Controller/LuckyController.php // ... - class LuckyController extends Controller + class LuckyController { // ... @@ -137,7 +136,7 @@ You can even shorten this with the handy :class:`Symfony\\Component\\HttpFoundat // --> don't forget this new use statement use Symfony\Component\HttpFoundation\JsonResponse; - class LuckyController extends Controller + class LuckyController { // ... @@ -170,7 +169,7 @@ at the end: // src/AppBundle/Controller/LuckyController.php // ... - class LuckyController extends Controller + class LuckyController { /** * @Route("/lucky/number/{count}") @@ -224,7 +223,7 @@ The best part is that you can access this value and use it in your controller:: // src/AppBundle/Controller/LuckyController.php // ... - class LuckyController extends Controller + class LuckyController { /**