@@ -145,7 +145,7 @@ and ``redirect()`` methods::
145
145
use Symfony\Component\HttpFoundation\RedirectResponse;
146
146
147
147
// ...
148
- public function indexAction ()
148
+ public function index ()
149
149
{
150
150
// redirect to the "homepage" route
151
151
return $this->redirectToRoute('homepage');
@@ -209,7 +209,7 @@ If you need a service in a controller, just type-hint an argument with its class
209
209
/**
210
210
* @Route("/lucky/number/{max}")
211
211
*/
212
- public function numberAction ($max, LoggerInterface $logger)
212
+ public function number ($max, LoggerInterface $logger)
213
213
{
214
214
$logger->info('We are logging!');
215
215
// ...
@@ -303,7 +303,7 @@ special type of exception::
303
303
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
304
304
305
305
// ...
306
- public function indexAction ()
306
+ public function index ()
307
307
{
308
308
// retrieve the object from database
309
309
$product = ...;
@@ -348,7 +348,7 @@ object. To get it in your controller, just add it as an argument and
348
348
349
349
use Symfony\Component\HttpFoundation\Request;
350
350
351
- public function indexAction (Request $request, $firstName, $lastName)
351
+ public function index (Request $request, $firstName, $lastName)
352
352
{
353
353
$page = $request->query->get('page', 1);
354
354
@@ -392,7 +392,7 @@ To get the session, add an argument and type-hint it with
392
392
393
393
use Symfony\Component\HttpFoundation\Session\SessionInterface;
394
394
395
- public function indexAction (SessionInterface $session)
395
+ public function index (SessionInterface $session)
396
396
{
397
397
// store an attribute for reuse during a later user request
398
398
$session->set('foo', 'bar');
@@ -432,7 +432,7 @@ For example, imagine you're processing a :doc:`form </forms>` submission::
432
432
433
433
use Symfony\Component\HttpFoundation\Request;
434
434
435
- public function updateAction (Request $request)
435
+ public function update (Request $request)
436
436
{
437
437
// ...
438
438
@@ -524,7 +524,7 @@ the ``Request`` class::
524
524
525
525
use Symfony\Component\HttpFoundation\Request;
526
526
527
- public function indexAction (Request $request)
527
+ public function index (Request $request)
528
528
{
529
529
$request->isXmlHttpRequest(); // is it an Ajax request?
530
530
@@ -579,7 +579,7 @@ To return JSON from a controller, use the ``json()`` helper method. This returns
579
579
special ``JsonResponse `` object that encodes the data automatically::
580
580
581
581
// ...
582
- public function indexAction ()
582
+ public function index ()
583
583
{
584
584
// returns '{"username":"jane.doe"}' and sets the proper Content-Type header
585
585
return $this->json(array('username' => 'jane.doe'));
0 commit comments