This repository was archived by the owner on Sep 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +38
-2
lines changed Expand file tree Collapse file tree 1 file changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ generated or from the environment (e.g. you could use the current locale in
10
10
the route).
11
11
12
12
13
- content_method
14
- --------------
13
+ `` content_method ``
14
+ ------------------
15
15
16
16
The ``content_method `` provider allows the content object (e.g. a forum
17
17
``Topic ``) to specify a path using one of its methods. This is quite a powerful
@@ -117,6 +117,42 @@ feature.
117
117
</mapping>
118
118
</auto-mapping>
119
119
120
+ ``container ``
121
+ -------------
122
+
123
+ .. versionadded :: 1.1
124
+ The container provider was introduced in RoutingAutoBundle 1.1
125
+
126
+ The ``container `` provider allows you to use parameters which have
127
+ been defined in the Symfony DI container.
128
+
129
+ .. configuration-block ::
130
+
131
+ .. code-block :: yaml
132
+
133
+ # src/Acme/ForumBundle/Resources/config/cmf_routing_auto.yml
134
+ Acme\ForumBundle\Document\Article :
135
+ uri_schema : {base_url}/good-day
136
+ token_providers :
137
+ base_url : [container, { parameter: my_parameter.base_path }
138
+
139
+ .. code-block: xml
140
+
141
+ <!-- src/Acme/ForumBundle/Resources/config/cmf_routing_auto.xml -->
142
+ <?xml version="1.0" ?>
143
+ <auto-mapping xmlns="http://cmf.symfony.com/schema/routing_auto">
144
+ <mapping class="Acme\ForumBundle\Document\Article" uri-schema="/{base_url}/good-day">
145
+ <token-provider token="base_url" name="container" >
146
+ <option name="parameter">my_parameter.base_path</option>
147
+ </token>
148
+ </mapping>
149
+ </auto-mapping>
150
+
151
+ .. note ::
152
+
153
+ Parameters from the container will not be slugified. It is your
154
+ responsibility to ensure that they contain safe characters.
155
+
120
156
Options
121
157
~~~~~~~
122
158
You can’t perform that action at this time.
0 commit comments