Skip to content

Commit c354c00

Browse files
committed
Fixed code examples in book/controller
1 parent 1690c93 commit c354c00

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

book/controller.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ a controller object. Controllers are also called *actions*.
9494
:linenos:
9595
9696
// src/Acme/HelloBundle/Controller/HelloController.php
97-
9897
namespace Acme\HelloBundle\Controller;
98+
9999
use Symfony\Component\HttpFoundation\Response;
100100
101101
class HelloController
@@ -208,8 +208,8 @@ passed to that method:
208208
209209
<?php
210210
// src/Acme/HelloBundle/Controller/HelloController.php
211-
212211
namespace Acme\HelloBundle\Controller;
212+
213213
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
214214
215215
class HelloController extends Controller
@@ -276,7 +276,7 @@ the following guidelines in mind while you develop.
276276

277277
public function indexAction($last_name, $color, $first_name)
278278
{
279-
// ..
279+
// ...
280280
}
281281

282282
* **Each required controller argument must match up with a routing parameter**
@@ -286,15 +286,15 @@ the following guidelines in mind while you develop.
286286

287287
public function indexAction($first_name, $last_name, $color, $foo)
288288
{
289-
// ..
289+
// ...
290290
}
291291

292292
Making the argument optional, however, is perfectly ok. The following
293293
example would not throw an exception::
294294

295295
public function indexAction($first_name, $last_name, $color, $foo = 'bar')
296296
{
297-
// ..
297+
// ...
298298
}
299299

300300
* **Not all routing parameters need to be arguments on your controller**
@@ -304,7 +304,7 @@ the following guidelines in mind while you develop.
304304

305305
public function indexAction($first_name, $color)
306306
{
307-
// ..
307+
// ...
308308
}
309309

310310
.. tip::
@@ -349,8 +349,8 @@ Add the ``use`` statement atop the ``Controller`` class and then modify the
349349
.. code-block:: php
350350
351351
// src/Acme/HelloBundle/Controller/HelloController.php
352-
353352
namespace Acme\HelloBundle\Controller;
353+
354354
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
355355
use Symfony\Component\HttpFoundation\Response;
356356
@@ -448,7 +448,7 @@ object that's returned from that controller::
448448
'color' => 'green'
449449
));
450450

451-
// further modify the response or return it directly
451+
// ... further modify the response or return it directly
452452
453453
return $response;
454454
}
@@ -570,7 +570,7 @@ If you're extending the base controller class, do the following::
570570

571571
public function indexAction()
572572
{
573-
$product = // retrieve the object from database
573+
$product = ... retrieve the object from database;
574574
if (!$product) {
575575
throw $this->createNotFoundException('The product does not exist');
576576
}

0 commit comments

Comments
 (0)