Skip to content

Commit e48c528

Browse files
committed
minor #5979 [Book] Do not extend the base controller before introducing it (ogizanagi)
This PR was merged into the 2.3 branch. Discussion ---------- [Book] Do not extend the base controller before introducing it | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3+ | Fixed tickets | #5969 Commits ------- 98c4525 [Book] Do not extend the base controller before introducing it
2 parents e6caa72 + 98c4525 commit e48c528

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

book/page_creation.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ a method inside of it that will be executed when someone goes to ``/lucky/number
3939
// src/AppBundle/Controller/LuckyController.php
4040
namespace AppBundle\Controller;
4141

42-
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
4342
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
4443
use Symfony\Component\HttpFoundation\Response;
4544

46-
class LuckyController extends Controller
45+
class LuckyController
4746
{
4847
/**
4948
* @Route("/lucky/number")
@@ -104,7 +103,7 @@ Just add a second method to ``LuckyController``::
104103
// src/AppBundle/Controller/LuckyController.php
105104
// ...
106105

107-
class LuckyController extends Controller
106+
class LuckyController
108107
{
109108
// ...
110109

@@ -137,7 +136,7 @@ You can even shorten this with the handy :class:`Symfony\\Component\\HttpFoundat
137136
// --> don't forget this new use statement
138137
use Symfony\Component\HttpFoundation\JsonResponse;
139138

140-
class LuckyController extends Controller
139+
class LuckyController
141140
{
142141
// ...
143142

@@ -170,7 +169,7 @@ at the end:
170169
// src/AppBundle/Controller/LuckyController.php
171170
// ...
172171
173-
class LuckyController extends Controller
172+
class LuckyController
174173
{
175174
/**
176175
* @Route("/lucky/number/{count}")
@@ -224,7 +223,7 @@ The best part is that you can access this value and use it in your controller::
224223
// src/AppBundle/Controller/LuckyController.php
225224
// ...
226225

227-
class LuckyController extends Controller
226+
class LuckyController
228227
{
229228

230229
/**

0 commit comments

Comments
 (0)