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

Commit 663906d

Browse files
committed
cleanup routing documentation
1 parent ad2de8f commit 663906d

File tree

5 files changed

+254
-287
lines changed

5 files changed

+254
-287
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
``enabled``
2+
***********
3+
4+
... true false only
5+
6+
**type**: ``bool`` **valid values**: ``true|false`` **default**: ``false``
7+
8+
If ``true``, the admin classes for the routing are loaded and available for
9+
Sonata.
10+
11+
.. note::
12+
To see an admin on the sonata dashboard, you still need to configure the
13+
dashboard to show the admin service in question.

bundles/routing/configuration.rst

Lines changed: 24 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Configuration
1818

1919
**prototype**: ``array`` **default**: ``{ router.default: 100 }``
2020

21-
This defines the routers to use in the chain. By default, only the Symfony2
21+
This defines the routers to use in the chain. By default, only the Symfony
2222
router is used. The key is the name of the service and the value is the
2323
priority. The chain is sorted from the highest to the lowest priority.
2424

@@ -72,9 +72,9 @@ To add the ``DynamicRouter``, use the following configuration:
7272

7373
**type**: ``Boolean`` **default**: ``true``
7474

75-
If this option is set to ``false``, the default Symfony2 router will *not* be
75+
If this option is set to ``false``, the default Symfony router will *not* be
7676
overridden by the ``ChainRouter``. By default, the ``ChainRouter`` will
77-
override the default Symfony2 router, but it will pass all requests to the
77+
override the default Symfony router, but it will pass all requests to the
7878
default router, because :ref:`no other routers were set <reference-config-routing-chain_routers>`.
7979

8080

@@ -142,10 +142,9 @@ defaults to ``cmf_content.controller:indexAction``.
142142

143143
**type**: ``string`` **default**: value of ``generic_controller``
144144

145-
The default controller to use if none of the enhancers found a controller. The
146-
value is the name of a controller using either the
147-
``AppBundle::Page::index`` or ``app.page_controller:indexAction``
148-
notation.
145+
The default controller to use if none of the enhancers found a controller.
146+
Accepts any valid Symfony controller reference.
147+
149148

150149
``controllers_by_type``
151150
.......................
@@ -203,7 +202,7 @@ This object is checked for being ``instanceof`` the class names in this map.
203202
other extending classes. The order in which the classes are specified, matters.
204203
The first match is taken.
205204

206-
If matched, the controller will be set as ``_controller``, making Symfony2
205+
If matched, the controller will be set as ``_controller``, making Symfony
207206
choose this controller to handle the request.
208207

209208
.. configuration-block::
@@ -307,10 +306,10 @@ setting is set as controller.
307306

308307
**type**: ``scalar``, **default**: ``0``
309308

310-
If this value is set to a number bigger than 0, the routes from the database
311-
are returned in the ``getRouteCollection``. The limit serves to prevent huge
312-
route lists if you have a large database. Setting the limit to ``false``
313-
disables the limit entirely.
309+
If this value is set to a number bigger than 0, the ``getRouteCollection``
310+
method returns a collection of routes read from the database. The limit serves
311+
to prevent huge route lists if you have a large database. Setting the limit to
312+
``false`` disables the limit entirely and attempts to return all routes.
314313

315314
``persistence``
316315
...............
@@ -334,9 +333,6 @@ disables the limit entirely.
334333
route_basepaths:
335334
- /cms/routes
336335
- /cms/simple
337-
content_basepath: /cms/content
338-
admin_basepath: /cms/routes
339-
use_sonata_admin: auto
340336
enable_initializer: true
341337
342338
.. code-block:: xml
@@ -350,9 +346,6 @@ disables the limit entirely.
350346
<phpcr
351347
enabled="false"
352348
manager-name="null"
353-
content-basepath="/cms/content"
354-
admin-basepath="/cms/routes"
355-
use-sonata-admin="auto"
356349
enable_initializer="true"
357350
>
358351
<route-basepath>/cms/routes</route-basepath>
@@ -376,9 +369,6 @@ disables the limit entirely.
376369
'/cms/routes',
377370
'/cms/simple',
378371
],
379-
'content_basepath' => '/cms/content',
380-
'admin_basepath' => '/cms/routes',
381-
'use_sonata_admin' => 'auto',
382372
'enable_initializer' => true,
383373
],
384374
],
@@ -407,46 +397,7 @@ manager_name
407397
A set of paths where routes are located in the PHPCR tree.
408398

409399
If the :doc:`CoreBundle <../core/introduction>` is registered, this will
410-
default to ``%cmf_core.persistence.phpcr.basepath%/routes``. If the
411-
:doc:`SimpleCmsBundle <../simple_cms/introduction>` is registered as well,
412-
the SimpleCmsBundle basepath will be added as an additional route basepath.
413-
414-
``content_basepath``
415-
********************
416-
417-
**type**: ``string`` **default**: ``/cms/content``
418-
419-
The basepath for content objects in the PHPCR tree. This information is used
420-
with the sonata admin to offer the correct subtree to select content documents.
421-
422-
If the :doc:`CoreBundle <../core/introduction>` is registered, this will default to
423-
``%cmf_core.persistence.phpcr.basepath%/content``.
424-
425-
``admin_basepath``
426-
******************
427-
428-
**type**: ``string`` **default**: first value of ``route_basepaths``
429-
430-
The path at which to create routes with Sonata admin. There can be additional
431-
route basepaths, but you will need your own tools to edit those.
432-
433-
``use_sonata_admin``
434-
********************
435-
436-
**type**: ``enum`` **valid values**: ``true|false|auto`` **default**: ``auto``
437-
438-
If ``true``, the admin classes for the routing are loaded and available for
439-
sonata. If set to ``auto``, the admin services are activated only if the
440-
SonataPhpcrAdminBundle is present.
441-
442-
.. note::
443-
444-
To see the route administration on the sonata dashboard, you still need to
445-
configure it to show the items ``cmf_routing.route_admin`` and
446-
``cmf_routing.redirect_route_admin``.
447-
448-
If the :doc:`CoreBundle <../core/introduction>` is registered, this will
449-
default to the value of ``cmf_core.persistence.phpcr.use_sonata_admin``.
400+
default to ``%cmf_core.persistence.phpcr.basepath%/routes``.
450401

451402
``enable_initializer``
452403
**********************
@@ -456,18 +407,12 @@ default to the value of ``cmf_core.persistence.phpcr.use_sonata_admin``.
456407
.. versionadded:: 1.3
457408
This configuration option was introduced in RoutingBundle 1.3.
458409

459-
The bundle comes with an initializer that creates the nodes for the ``admin_basepath``
460-
automatically when initializing the repository or loading fixtures. Sometimes this
461-
is not what you want, as the created node is of type 'Generic' and sometimes this
462-
already needs to be a route (for the homepage). Set this to false to disable the
463-
initializer when you create your nodes your self (e.g. using Alice_).
464-
465-
.. caution::
466-
467-
Initializers are forced to be disabled when Sonata Admin is not enabled.
468-
In such cases, you might have multiple route basepaths which are created
469-
by other sources. If the route basepath isn't created by another source,
470-
you have to configure an :ref:`initializer <phpcr-odm-repository-initializers>`.
410+
The bundle comes with an initializer that creates the necessary nodes for all
411+
``route_basepaths`` roots to exist automatically when initializing the
412+
repository or loading fixtures. Sometimes this is not what you want, as the
413+
created node is of type 'Generic' and you might want the document to be a route
414+
(for the homepage). Set this to false to disable the initializer when you
415+
create your nodes yourself in your own :ref:`initializer <phpcr-odm-repository-initializers>`.
471416

472417
``orm``
473418
"""""""
@@ -564,14 +509,15 @@ priority.
564509

565510
**type**: ``scalar`` **default**: ``null``
566511

567-
To use a content repository when creating URLs, this option can be set to the
568-
content repository service.
512+
One way for routes to specify content is by specifying the content ID. The
513+
responsible route enhancer asks the content repository specified here for the
514+
content. The repository has to implement ``Symfony\Cmf\Component\Routing\ContentRepositoryInterface``.
569515

570516
.. note::
571517

572-
If PHPCR is enabled, it'll automatically use the phpcr content repository.
573-
This can be overridden by this option. ORM doesn't have a content
574-
repository at the moment.
518+
If PHPCR is enabled, this setting will default to a generic PHPCR content
519+
repository that tries to use the content ID as PHPCR path. ORM doesn't have
520+
a content repository at the moment.
575521

576522
.. _reference-config-routing-locales:
577523

@@ -641,5 +587,3 @@ no locale in their static pattern get the ``auto_locale_pattern`` option set.
641587

642588
This is ignored if there are no ``locales`` configured. It makes no sense to
643589
enable this option when ``match_implicit_locale`` is disabled.
644-
645-
.. _Alice: https://github.com/nelmio/alice

0 commit comments

Comments
 (0)