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

Commit fee2017

Browse files
committed
Merge pull request #715 from symfony-cmf/route_basepaths
Document route basepaths
2 parents 301a12d + 4d2e75a commit fee2017

File tree

3 files changed

+27
-14
lines changed

3 files changed

+27
-14
lines changed

bundles/routing/configuration.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,18 @@ manager_name
381381
``route_basepaths``
382382
*******************
383383

384-
**type**: ``array`` **default**: ``array('/cms/routes')``
384+
.. versionadded:: 1.3
385+
The ``route_basepaths`` setting was introduced in version 1.3. Prior to
386+
1.3, you could only configure one basepath using ``route_basepath``.
387+
388+
**type**: ``string`` | ``array`` **default**: ``/cms/routes``
385389

386-
The basepaths where to look for routes in the PHPCR tree.
390+
A set of paths where routes are located in the PHPCR tree.
387391

388392
If the :doc:`CoreBundle <../core/introduction>` is registered, this will
389393
default to ``%cmf_core.persistence.phpcr.basepath%/routes``. If the
390394
:doc:`SimpleCmsBundle <../simple_cms/introduction>` is registered as well,
391-
this will additionally default to ``%cmf_core.persistence.phpcr.basepath%/simple``.
395+
the SimpleCmsBundle basepath will be added as an additional route basepath.
392396

393397
``content_basepath``
394398
********************
@@ -404,7 +408,7 @@ If the :doc:`CoreBundle <../core/introduction>` is registered, this will default
404408
``admin_basepath``
405409
******************
406410

407-
**type**: ``string`` **default**: first value of route_basepaths
411+
**type**: ``string`` **default**: first value of ``route_basepaths``
408412

409413
The path at which to create routes with Sonata admin. There can be additional
410414
route basepaths, but you will need your own tools to edit those.

quick_tour/the_router.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ new routes in ``/cms/routes``:
9696
dynamic:
9797
persistence:
9898
phpcr:
99-
route_basepath: /cms/routes
99+
route_basepaths: /cms/routes
100+
# /cms/routes is the default base path, the above code is
101+
# equivalent to:
102+
# phpcr: true
100103
101104
.. code-block:: xml
102105
@@ -116,7 +119,13 @@ new routes in ``/cms/routes``:
116119
117120
<dynamic>
118121
<persistence>
119-
<phpcr route-basepath="/cms/routes" />
122+
<phpcr>
123+
<route-basepath>/cms/routes</route-basepath>
124+
</phpcr>
125+
<!-- /cms/routes is the default base path, the above
126+
code is equivalent to:
127+
<phpcr />
128+
--->
120129
</persistence>
121130
</dynamic>
122131
</config>
@@ -138,8 +147,12 @@ new routes in ``/cms/routes``:
138147
'dynamic' => array(
139148
'persistence' => array(
140149
'phpcr' => array(
141-
'route_basepath' => '/cms/routes',
150+
'route_basepaths' => '/cms/routes',
142151
),
152+
/* /cms/routes is the default base path, the above code is
153+
equivalent to:
154+
'phpcr' => true,
155+
*/
143156
),
144157
),
145158
));

tutorial/auto-routing.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ Add the following to your application configuration:
7272
dynamic:
7373
enabled: true
7474
persistence:
75-
phpcr:
76-
route_basepath: /cms/routes
75+
phpcr: true
7776
7877
.. code-block:: xml
7978
@@ -86,7 +85,7 @@ Add the following to your application configuration:
8685
</chain>
8786
<dynamic>
8887
<persistence>
89-
<phpcr route-basepath="/cms/routes" />
88+
<phpcr />
9089
</persistence>
9190
</dynamic>
9291
</config>
@@ -98,10 +97,7 @@ Add the following to your application configuration:
9897
$container->loadFromExtension('cmf_routing', array(
9998
'dynamic' => array(
10099
'persistence' => array(
101-
'phpcr' => array(
102-
'enabled' => true,
103-
'route_basepath' => '/cms/routes',
104-
),
100+
'phpcr' => true,
105101
),
106102
),
107103
));

0 commit comments

Comments
 (0)