@@ -28,6 +28,7 @@ To add the ``DynamicRouter``, use the following configuration:
28
28
29
29
.. code-block :: yaml
30
30
31
+ # app/config/config.yml
31
32
cmf_routing :
32
33
chain :
33
34
routers_by_id :
@@ -36,6 +37,7 @@ To add the ``DynamicRouter``, use the following configuration:
36
37
37
38
.. code-block :: xml
38
39
40
+ <!-- app/config/config.xml -->
39
41
<?xml version =" 1.0" encoding =" UTF-8" ?>
40
42
<container xmlns =" http://symfony.com/schema/dic/services" >
41
43
@@ -50,14 +52,15 @@ To add the ``DynamicRouter``, use the following configuration:
50
52
51
53
.. code-block :: php
52
54
53
- $container->loadFromExtension('cmf_routing', array(
54
- 'chain' => array(
55
- 'routers_by_id' => array(
55
+ // app/config/config.php
56
+ $container->loadFromExtension('cmf_routing', [
57
+ 'chain' => [
58
+ 'routers_by_id' => [
56
59
'cmf_routing.dynamic_router' => 200,
57
60
'router.default' => 100,
58
- ) ,
59
- ) ,
60
- ) );
61
+ ] ,
62
+ ] ,
63
+ ] );
61
64
62
65
.. tip ::
63
66
@@ -79,12 +82,14 @@ default router, because :ref:`no other routers were set <reference-config-routin
79
82
80
83
.. code-block :: yaml
81
84
85
+ # app/config/config.yml
82
86
cmf_routing :
83
87
chain :
84
88
replace_symfony_router : true
85
89
86
90
.. code-block :: xml
87
91
92
+ <!-- app/config/config.xml -->
88
93
<?xml version =" 1.0" encoding =" UTF-8" ?>
89
94
<container xmlns =" http://symfony.com/schema/dic/services" >
90
95
@@ -98,11 +103,12 @@ default router, because :ref:`no other routers were set <reference-config-routin
98
103
99
104
.. code-block :: php
100
105
101
- $container->loadFromExtension('cmf_routing', array(
102
- 'chain' => array(
106
+ // app/config/config.php
107
+ $container->loadFromExtension('cmf_routing', [
108
+ 'chain' => [
103
109
'replace_symfony_router' => true,
104
- ) ,
105
- ) );
110
+ ] ,
111
+ ] );
106
112
107
113
108
114
.. _reference-config-routing-dynamic :
@@ -123,10 +129,9 @@ generic_controller
123
129
124
130
**type **: ``string `` **default **: ``null ``
125
131
126
- The controller to use when the route enhancers only determined the template but
127
- no explicit controller. The value is the name of a controller using either the
128
- ``AcmeDemoBundle::Page::index `` or ``acme_demo.controller.page:indexAction ``
129
- notation.
132
+ This configuration specifies the controller that is used when the route
133
+ enhancers define a template but no explicit controller. It accepts any valid
134
+ Symfony controller reference.
130
135
131
136
If the :doc: `CoreBundle <../core/introduction >` and
132
137
:doc: `ContentBundle <../content/introduction >` are registered, this
@@ -139,7 +144,7 @@ defaults to ``cmf_content.controller:indexAction``.
139
144
140
145
The default controller to use if none of the enhancers found a controller. The
141
146
value is the name of a controller using either the
142
- ``AcmeDemoBundle ::Page::index `` or ``acme_demo.controller.page :indexAction ``
147
+ ``AppBundle ::Page::index `` or ``app.page_controller :indexAction ``
143
148
notation.
144
149
145
150
``controllers_by_type ``
@@ -155,34 +160,36 @@ type:
155
160
156
161
.. code-block :: yaml
157
162
163
+ # app/config/config.yml
158
164
cmf_routing :
159
165
dynamic :
160
166
controllers_by_type :
161
- editable : acme_main.controller:editableAction
167
+ editable : AppBundle:Cms:editable
162
168
163
169
.. code-block :: xml
164
170
165
-
171
+ <!-- app/config/config.xml -->
166
172
<?xml version =" 1.0" encoding =" UTF-8" ?>
167
173
<container xmlns =" http://symfony.com/schema/dic/services" >
168
174
169
175
<config xmlns =" http://cmf.symfony.com/schema/dic/routing" >
170
176
<dynamic >
171
- <controller-by-type type =" editable" >acme_main.controller:editableAction </controller-by-type >
177
+ <controller-by-type type =" editable" >AppBundle:Cms:editable </controller-by-type >
172
178
</dynamic >
173
179
</config >
174
180
175
181
</container >
176
182
177
183
.. code-block :: php
178
184
179
- $container->loadFromExtension('cmf_routing', array(
180
- 'dynamic' => array(
181
- 'controllers_by_type' => array(
182
- 'editable' => 'acme_main.controller:editableAction',
183
- ),
184
- ),
185
- ));
185
+ // app/config/config.php
186
+ $container->loadFromExtension('cmf_routing', [
187
+ 'dynamic' => [
188
+ 'controllers_by_type' => [
189
+ 'editable' => 'AppBundle:Cms:editable',
190
+ ],
191
+ ],
192
+ ]);
186
193
187
194
controllers_by_class
188
195
....................
@@ -203,13 +210,15 @@ choose this controller to handle the request.
203
210
204
211
.. code-block :: yaml
205
212
213
+ # app/config/config.yml
206
214
cmf_routing :
207
215
dynamic :
208
216
controllers_by_class :
209
217
Symfony\Cmf\Bundle\ContentBundle\Document\StaticContent : cmf_content.controller:indexAction
210
218
211
219
.. code-block :: xml
212
220
221
+ <!-- app/config/config.xml -->
213
222
<?xml version =" 1.0" encoding =" UTF-8" ?>
214
223
<container xmlns =" http://symfony.com/schema/dic/services" >
215
224
@@ -226,10 +235,13 @@ choose this controller to handle the request.
226
235
227
236
.. code-block :: php
228
237
229
- $container->loadFromExtension('cmf_routing', array(
230
- 'dynamic' => array(
231
- 'controllers_by_class' => array(
232
- 'Symfony\Cmf\Bundle\ContentBundle\Document\StaticContent' => 'cmf_content.controller:indexAction',
238
+ // app/config/config.php
239
+ use Symfony\Cmf\Bundle\ContentBundle\Document\StaticContent;
240
+
241
+ $container->loadFromExtension('cmf_routing', [
242
+ 'dynamic' => [
243
+ 'controllers_by_class' => [
244
+ StaticContent::class => 'cmf_content.controller:indexAction',
233
245
),
234
246
),
235
247
));
@@ -255,16 +267,17 @@ setting is set as controller.
255
267
256
268
.. code-block :: yaml
257
269
270
+ # app/config/config.yml
258
271
cmf_routing :
259
272
dynamic :
260
273
templates_by_class :
261
274
Symfony\Cmf\Bundle\ContentBundle\Document\StaticContent : CmfContentBundle:StaticContent:index.html.twig
262
275
263
276
.. code-block :: xml
264
277
278
+ <!-- app/config/config.xml -->
265
279
<?xml version =" 1.0" encoding =" UTF-8" ?>
266
280
<container xmlns =" http://symfony.com/schema/dic/services" >
267
-
268
281
<config xmlns =" http://cmf.symfony.com/schema/dic/routing" >
269
282
<dynamic >
270
283
<template-by-class
@@ -278,10 +291,13 @@ setting is set as controller.
278
291
279
292
.. code-block :: php
280
293
281
- $container->loadFromExtension('cmf_routing', array(
282
- 'dynamic' => array(
283
- 'templates_by_class' => array(
284
- 'Symfony\Cmf\Bundle\ContentBundle\Document\StaticContent' => 'CmfContentBundle:StaticContent:index.html.twig',
294
+ // app/config/config.php
295
+ use Symfony\Cmf\Bundle\ContentBundle\Document\StaticContent;
296
+
297
+ $container->loadFromExtension('cmf_routing', [
298
+ 'dynamic' => [
299
+ 'templates_by_class' => [
300
+ StaticContent::class => 'CmfContentBundle:StaticContent:index.html.twig',
285
301
),
286
302
),
287
303
));
@@ -349,24 +365,25 @@ disables the limit entirely.
349
365
350
366
.. code-block :: php
351
367
352
- $container->loadFromExtension('cmf_routing', array(
353
- 'dynamic' => array(
354
- 'persistence' => array(
355
- 'phpcr' => array(
368
+ # app/config/config.php
369
+ $container->loadFromExtension('cmf_routing', [
370
+ 'dynamic' => [
371
+ 'persistence' => [
372
+ 'phpcr' => [
356
373
'enabled' => false,
357
374
'manager_name' => null,
358
- 'route_basepaths' => array(
375
+ 'route_basepaths' => [
359
376
'/cms/routes',
360
377
'/cms/simple',
361
- )
378
+ ],
362
379
'content_basepath' => '/cms/content',
363
380
'admin_basepath' => '/cms/routes',
364
381
'use_sonata_admin' => 'auto',
365
382
'enable_initializer' => true,
366
- ) ,
367
- ) ,
368
- ) ,
369
- ) );
383
+ ] ,
384
+ ] ,
385
+ ] ,
386
+ ] );
370
387
371
388
enabled
372
389
*******
@@ -470,7 +487,7 @@ If ``true``, the ORM is included in the service container.
470
487
The name of the Doctrine Manager to use.
471
488
472
489
``route_class ``
473
- ****************
490
+ ***************
474
491
475
492
**type **: ``string `` **default **: ``'Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm\Route' ``
476
493
@@ -511,34 +528,36 @@ priority.
511
528
512
529
.. code-block :: yaml
513
530
531
+ # app/config/config.yml
514
532
cmf_routing :
515
533
dynamic :
516
534
route_filters_by_id :
517
- acme_main.routing.foo_filter : 100
535
+ app.routing_filter : 100
518
536
519
537
.. code-block :: xml
520
538
521
-
539
+ <!-- app/config/config.xml -->
522
540
<?xml version =" 1.0" encoding =" UTF-8" ?>
523
541
<container xmlns =" http://symfony.com/schema/dic/services" >
524
542
525
543
<config xmlns =" http://cmf.symfony.com/schema/dic/routing" >
526
544
<dynamic >
527
- <route-filter-by-id id =" acme_main.routing.foo_filter " >100</route-filter-by-id >
545
+ <route-filter-by-id id =" app.routing_filter " >100</route-filter-by-id >
528
546
</dynamic >
529
547
</config >
530
548
531
549
</container >
532
550
533
551
.. code-block :: php
534
552
535
- $container->loadFromExtension('cmf_routing', array(
536
- 'dynamic' => array(
537
- 'route_filters_by_id' => array(
538
- 'acme_main.routing.foo_filter' => 100,
539
- ),
540
- ),
541
- ));
553
+ // app/config/config.php
554
+ $container->loadFromExtension('cmf_routing', [
555
+ 'dynamic' => [
556
+ 'route_filters_by_id' => [
557
+ 'app.routing_filter' => 100,
558
+ ],
559
+ ],
560
+ ]);
542
561
543
562
``content_repository_service_id ``
544
563
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -568,7 +587,7 @@ service.
568
587
``locales ``
569
588
~~~~~~~~~~~
570
589
571
- **type **: ``array `` **default **: ``array() ``
590
+ **type **: ``array `` **default **: ``[] ``
572
591
573
592
To enable multi-language, set the valid locales in this option.
574
593
0 commit comments