@@ -305,8 +305,11 @@ phpcr
305
305
phpcr :
306
306
enabled : false
307
307
manager_name : ~
308
- route_basepath : /cms/routes
308
+ route_basepaths :
309
+ - /cms/routes
310
+ - /cms/simple
309
311
content_basepath : /cms/content
312
+ admin_basepath : /cms/routes
310
313
use_sonata_admin : auto
311
314
312
315
.. code-block :: xml
@@ -320,10 +323,13 @@ phpcr
320
323
<phpcr
321
324
enabled =" false"
322
325
manager-name =" null"
323
- route-basepath =" /cms/routes"
324
326
content-basepath =" /cms/content"
327
+ admin-basepath =" /cms/routes"
325
328
use-sonata-admin =" auto"
326
- />
329
+ >
330
+ <route-basepath >/cms/routes</route-basepath >
331
+ <route-basepath >/cms/simple</route-basepath >
332
+ </phpcr >
327
333
</persistence >
328
334
</dynamic >
329
335
</config >
@@ -337,8 +343,12 @@ phpcr
337
343
'phpcr' => array(
338
344
'enabled' => false,
339
345
'manager_name' => null,
340
- 'route_basepath' => '/cms/routes',
346
+ 'route_basepaths' => array(
347
+ '/cms/routes',
348
+ '/cms/simple',
349
+ )
341
350
'content_basepath' => '/cms/content',
351
+ 'admin_basepath' => '/cms/routes',
342
352
'use_sonata_admin' => 'auto',
343
353
),
344
354
),
@@ -356,27 +366,37 @@ manager_name
356
366
357
367
.. include :: partials/persistence_phpcr_manager_name.rst.inc
358
368
359
- route_basepath
369
+ route_basepaths
360
370
**************
361
371
362
- **type **: ``string `` **default **: ``/cms/routes ``
372
+ **type **: ``array `` **default **: ``array(' /cms/routes') ``
363
373
364
- The basepath for routes in the PHPCR tree.
374
+ The basepaths where to look for routes in the PHPCR tree.
365
375
366
- If the :doc: `CoreBundle <../../bundles/core/index >` is registered, this will default to
367
- ``%cmf_core.persistence.phpcr.basepath%/routes ``.
376
+ If the :doc: `CoreBundle <../../bundles/core/index >` is registered, this will
377
+ default to ``%cmf_core.persistence.phpcr.basepath%/routes ``. If the
378
+ :doc: `SimpleCmsBundle <../../bundles/simplecms/index >` is registered as well,
379
+ this will additionally default to ``%cmf_core.persistence.phpcr.basepath%/simple ``.
368
380
369
381
content_basepath
370
382
****************
371
383
372
- **type **: ``content_basepath `` **default **: ``/cms/content ``
384
+ **type **: ``string `` **default **: ``/cms/content ``
373
385
374
386
The basepath for content objects in the PHPCR tree. This information is used
375
387
with the sonata admin to offer the correct subtree to select content documents.
376
388
377
389
If the :doc: `CoreBundle <../../bundles/core/index >` is registered, this will default to
378
390
``%cmf_core.persistence.phpcr.basepath%/content ``.
379
391
392
+ admin_basepath
393
+ **************
394
+
395
+ **type **: ``string `` **default **: first value of route_basepaths
396
+
397
+ The path at which to create routes with Sonata admin. There can be additional
398
+ route basepaths, but you will need your own tools to edit those.
399
+
380
400
use_sonata_admin
381
401
****************
382
402
@@ -487,12 +507,45 @@ content repository service.
487
507
This can be overriden by this option. ORM doesn't have a content
488
508
repository at the moment.
489
509
510
+ .. _reference-config-routing-locales :
511
+
490
512
locales
491
513
~~~~~~~
492
514
493
- **type **: ``array `` **default **:
515
+ **type **: ``array `` **default **: `` array() ``
494
516
495
517
To enable multilanguage, set the valid locales in this option.
496
518
497
519
If the :doc: `CoreBundle <../../bundles/core/index >` is registered, this will default to the value
498
520
of ``cmf_core.locales ``.
521
+
522
+ match_implicit_locale
523
+ ~~~~~~~~~~~~~~~~~~~~~
524
+
525
+ **type **: ``boolean `` **default **: ``true ``
526
+
527
+ Whether the route provider should look for routes without the locale.
528
+
529
+ For example, when the ``locales `` are ``de `` and ``en `` and the request has the
530
+ url ``de/my/path ``, the route provider will not only look for ``de/my/path ``,
531
+ ``de/my `` and ``de `` but also for ``my/path `` and ``my ``. This allows to use a
532
+ single route for multiple languages. This is used for example by the
533
+ :doc: `SimpleCms <../../bundles/simple_cms/index >`.
534
+
535
+ If you do not need this, disabling the option will gain some performance.
536
+
537
+ auto_locale_pattern
538
+ ~~~~~~~~~~~~~~~~~~~
539
+
540
+ **type **: ``boolean `` **default **: ``false ``
541
+
542
+ If you enable this option, the LocaleListener will ensure that routes that have
543
+ no locale in their static pattern get the ``auto_locale_pattern `` option set.
544
+
545
+ .. note ::
546
+
547
+ Enabling this option will prevent you from having any CMF Routes that match
548
+ URL without a locale in it.
549
+
550
+ This is ignored if there are no ``locales `` configured. It makes no sense to
551
+ enable this option when ``match_implicit_locale `` is disabled.
0 commit comments