Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 684d670

Browse files
jdespatisdbu
authored andcommitted
Fix routing chapter of book
Content title and body are not nullable and its setContent, not setRouteContent
1 parent c667ab3 commit 684d670

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

book/routing.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,10 @@ follows::
478478
$content = new StaticContent();
479479
$content->setParentDocument($dm->find(null, '/cms/content'));
480480
$content->setName('my-content');
481+
$content->setTitle('My Content');
482+
$content->setBody('Some Content');
481483
$dm->persist($content);
482-
$route->setRouteContent($content);
484+
$route->setContent($content);
483485

484486
// now define an id parameter; do not forget the leading slash if you
485487
// want /projects/{id} and not /projects{id}
@@ -505,7 +507,7 @@ also ``/projects`` as there is a default for the id parameter.
505507
doing it in a fixture like this).
506508

507509
Because you defined the ``{id}`` route parameter, your controller can expect an
508-
``$id`` parameter. Additionally, because you called setRouteContent on the
510+
``$id`` parameter. Additionally, because you called ``setContent`` on the
509511
route, your controller can expect the ``$contentDocument`` parameter.
510512
The content could be used to define an intro section that is the same for each
511513
project or other shared data. If you don't need content, you can just not set it

0 commit comments

Comments
 (0)