2
2
single: RoutingAuto; Bundles
3
3
single: RoutingAutoBundle
4
4
5
- Introduction
6
- ============
5
+ RoutingAutoBundle
6
+ =================
7
7
8
8
The RoutingAutoBundle allows you to automatically persist routes when
9
9
documents are persisted based on URI schemas and contextual information.
@@ -93,7 +93,7 @@ forum topic with the following fictional URI:
93
93
94
94
- ``https://mywebsite.com/my-forum/drinks/coffee ``
95
95
96
- The RoutingAutoBundle uses a URI schema definitions to define how routes are generated. A
96
+ The RoutingAutoBundle uses a URI schema to define how routes are generated. A
97
97
schema for the above URI would look like this (the bundle does not care about
98
98
the host or protocol):
99
99
@@ -105,7 +105,7 @@ You can see that ``my-forum`` is static (it will not change) but that
105
105
106
106
The value for tokens are provided by *token providers *.
107
107
108
- The schema definitions , token providers, and other configurations (more on this later) are
108
+ The schema, token providers, and other configurations (more on this later) are
109
109
contained within ``routing_auto.format `` files (currently ``xml `` and ``yaml `` are
110
110
supported). These files are contained either in your bundles
111
111
``Resources/config `` directory or in a custom location specified in
@@ -120,9 +120,7 @@ document could be defined as follows:
120
120
121
121
# src/Acme/ForumBundle/Resources/config/cmf_routing_auto.yml
122
122
Acme\ForumBundle\Document\Topic :
123
- definitions :
124
- main :
125
- uri_schema : /my-forum/{category}/{title}
123
+ uri_schema : /my-forum/{category}/{title}
126
124
token_providers :
127
125
category : [content_method, { method: getCategoryTitle, slugify: true }]
128
126
title : [content_method, { method: getTitle }] # slugify is true by default
@@ -132,9 +130,7 @@ document could be defined as follows:
132
130
<!-- src/Acme/ForumBundle/Resources/config/cmf_routing_auto.xml -->
133
131
<?xml version =" 1.0" ?>
134
132
<auto-mapping xmlns =" http://cmf.symfony.com/schema/routing_auto" >
135
- <mapping class =" Acme\ForumBundle\Document\Topic" >
136
- <definition name =" main" uri-schema =" /my-forum/{category}/{title}" />
137
-
133
+ <mapping class =" Acme\ForumBundle\Document\Topic" uri-schema =" /my-forum/{category}/{title}" >
138
134
<token-provider token =" category" name =" content_method" >
139
135
<option name =" method" >getCategoryName</option >
140
136
<option name =" slugify" >true</option >
@@ -190,7 +186,6 @@ Read more
190
186
* :doc: `token_providers `
191
187
* :doc: `conflict_resolvers `
192
188
* :doc: `defunct_route_handlers `
193
- * :doc: `definitions `
194
189
195
190
.. _`with composer` : http://getcomposer.org/
196
191
.. _`symfony-cmf/routing-auto-bundle` : https:/packagist.org/packages/symfony-cmf/routing-auto-bundle
0 commit comments