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

Commit e9d06d6

Browse files
committed
Merge pull request #453 from symfony-cmf/routing-dump-d
document the route_collection_limit configuration
2 parents fe3a61c + 8377371 commit e9d06d6

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

bundles/routing/dynamic.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,19 @@ For the implementation details, please refer to the
480480
:ref:`component-routing-generator` section in the the cmf routing component
481481
documentation.
482482

483+
.. sidebar:: Dumping Routes
484+
485+
The ``RouterInterface`` defines the method ``getRouteCollection`` to get
486+
all routes available in a router. The ``DynamicRouter`` is able to provide
487+
such a collection, however this feature is disabled by default to avoid
488+
dumping large numbers of routes. You can set
489+
``cmf_routing.dynamic.route_collection_limit`` to a value bigger than 0
490+
to have the router return routes up to the limit or ``false`` to disable
491+
limits and return all routes.
492+
493+
With this option activated, tools like the ``router:debug`` command or the
494+
`FOSJsRoutingBundle`_ will also show the routes coming from the database.
495+
483496
Handling RedirectRoutes
484497
-----------------------
485498

@@ -579,3 +592,4 @@ Read on in the chapter :doc:`customizing the dynamic router <dynamic_customize>`
579592
.. _`URL generating capabilities of Symfony2`: http://symfony.com/doc/current/book/routing.html#generating-urls
580593
.. _SonataDoctrinePHPCRAdminBundle: http://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/index.html
581594
.. _`configuring sonata admin`: http://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/reference/configuration.html
595+
.. _`FOSJsRoutingBundle`: https://github.com/FriendsOfSymfony/FOSJsRoutingBundle

reference/configuration/routing.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,16 @@ setting is set as controller.
286286
),
287287
));
288288
289+
route_collection_limit
290+
......................
291+
292+
**type**: ``scalar``, **default**: ``0``
293+
294+
If this value is set to a number bigger than 0, the routes from the database
295+
are returned in the ``getRouteCollection``. The limit serves to prevent huge
296+
route lists if you have a large database. Setting the limit to ``false``
297+
disables the limit entirely.
298+
289299
persistence
290300
...........
291301

0 commit comments

Comments
 (0)