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

Commit de422c4

Browse files
committed
Added some info
1 parent d3c74f7 commit de422c4

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

book/routing.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,14 @@ follows::
494494
This will give you a document that matches the URL ``/projects/<number>`` but
495495
also ``/projects`` as there is a default for the id parameter.
496496

497+
.. caution::
498+
499+
As you can see, the code explicitely creates the ``/cms/routes`` path.
500+
The RoutingBundle only creates this path automatically if the Sonata Admin
501+
was enabled in the routign configuration. Otherwise, it'll assume you
502+
do something yourself to create the path (by configuring an initializer
503+
or doing it in a fixture like this).
504+
497505
Because you defined the ``{id}`` route parameter, your controller can expect an
498506
``$id`` parameter. Additionally, because you called setRouteContent on the
499507
route, your controller can expect the ``$contentDocument`` parameter.

bundles/routing/configuration.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,12 @@ is not what you want, as the created node is of type 'Generic' and sometimes thi
441441
already needs to be a route (for the homepage). Set this to false to disable the
442442
initializer when you create your nodes your self (e.g. using Alice_).
443443

444+
.. caution::
445+
446+
The initializer is only run when the sonata admin is enabled. When you
447+
don't enable the sonata admin, it is assumed that you created an initializer
448+
yourself.
449+
444450
orm
445451
"""
446452

0 commit comments

Comments
 (0)