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

Commit 1a2b38b

Browse files
committed
Merge pull request #541 from uwej711/document_routing_enable_initializer
document enable_initalizer
2 parents c3792e5 + d63ccdc commit 1a2b38b

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

reference/configuration/routing.rst

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ phpcr
321321
content_basepath: /cms/content
322322
admin_basepath: /cms/routes
323323
use_sonata_admin: auto
324+
enable_initializer: true
324325
325326
.. code-block:: xml
326327
@@ -336,6 +337,7 @@ phpcr
336337
content-basepath="/cms/content"
337338
admin-basepath="/cms/routes"
338339
use-sonata-admin="auto"
340+
enable_initializer="true"
339341
>
340342
<route-basepath>/cms/routes</route-basepath>
341343
<route-basepath>/cms/simple</route-basepath>
@@ -351,15 +353,16 @@ phpcr
351353
'dynamic' => array(
352354
'persistence' => array(
353355
'phpcr' => array(
354-
'enabled' => false,
355-
'manager_name' => null,
356-
'route_basepaths' => array(
356+
'enabled' => false,
357+
'manager_name' => null,
358+
'route_basepaths' => array(
357359
'/cms/routes',
358360
'/cms/simple',
359361
)
360-
'content_basepath' => '/cms/content',
361-
'admin_basepath' => '/cms/routes',
362-
'use_sonata_admin' => 'auto',
362+
'content_basepath' => '/cms/content',
363+
'admin_basepath' => '/cms/routes',
364+
'use_sonata_admin' => 'auto',
365+
'enable_initializer' => true,
363366
),
364367
),
365368
),
@@ -424,6 +427,20 @@ SonataPhpcrAdminBundle is present.
424427
If the :doc:`CoreBundle <../../bundles/core/index>` is registered, this will
425428
default to the value of ``cmf_core.persistence.phpcr.use_sonata_admin``.
426429

430+
enable_initializer
431+
******************
432+
433+
**type**: ``boolean`` **default**: ``true``
434+
435+
.. versionadded:: 1.3
436+
This configuration option was introduced in RoutingBundle 1.3.
437+
438+
The bundle comes with an initializer that creates the nodes for the ``admin_basepath``
439+
automatically when initializing the repository or loading fixtures. Sometimes this
440+
is not what you want, as the created node is of type 'Generic' and sometimes this
441+
already needs to be a route (for the homepage). Set this to false to disable the
442+
initializer when you create your nodes your self (e.g. using Alice_).
443+
427444
orm
428445
"""
429446

@@ -575,3 +592,5 @@ no locale in their static pattern get the ``auto_locale_pattern`` option set.
575592

576593
This is ignored if there are no ``locales`` configured. It makes no sense to
577594
enable this option when ``match_implicit_locale`` is disabled.
595+
596+
.. _Alice: https://github.com/nelmio/alice

0 commit comments

Comments
 (0)