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

Commit 348432d

Browse files
datamagiwouterj
authored andcommitted
[#361] Update routing_auto.rst
Fixed some copy-pasting gone wrong in the last configuration example. Also made the service naming consistent between the last two examples, and made the "services:" context visible for the YAML examples. :)
1 parent 661c89e commit 348432d

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

bundles/routing_auto/customization.rst

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,19 @@ To use the path provider you must register it in the container and add the
3333

3434
.. code-block:: yaml
3535
36-
my_cms.some_bundle.path_provider.foobar:
37-
class: "FoobarProvider"
38-
scope: prototype
39-
tags:
40-
- { name: cmf_routing_auto.provider, alias: "foobar"}
36+
# app/config/config.yml
37+
services:
38+
my_cms_bundle.path_provider.foobar:
39+
class: "FoobarProvider"
40+
scope: prototype
41+
tags:
42+
- { name: cmf_routing_auto.provider, alias: "foobar"}
4143
4244
.. code-block:: xml
4345
46+
<!-- app/config/config.xml -->
4447
<service
45-
id="my_cms.some_bundle.path_provider.foobar"
48+
id="my_cms_bundle.path_provider.foobar"
4649
class="FoobarProvider"
4750
scope="prototype"
4851
>
@@ -51,13 +54,14 @@ To use the path provider you must register it in the container and add the
5154
5255
.. code-block:: php
5356
57+
// app/config/config.php
5458
use Symfony\Component\DependencyInjection\Definition;
5559
5660
$definition = new Definition('FooBarProvider');
5761
$definition->addTag('cmf_routing_auto.provider', array('alias' => 'foobar'));
5862
$definition->setScope('prototype');
5963
60-
$container->setDefinition('my_cms.some_bundle.path_provider.foobar', $definition);
64+
$container->setDefinition('my_cms_bundle.path_provider.foobar', $definition);
6165
6266
The ``FoobarProvider`` is now available as **foobar** in the routing auto
6367
configuration.
@@ -107,14 +111,17 @@ It is registered in the DI configuration as follows:
107111

108112
.. code-block:: yaml
109113
110-
cmf_routing_auto.not_exists_action.throw_exception
111-
class: "My\Cms\AutoRoute\PathNotExists\ThrowException"
112-
scope: prototype
113-
tags:
114-
- { name: cmf_routing_auto.provider, alias: "throw_exception"}
114+
# app/config/config.xml
115+
services:
116+
cmf_routing_auto.not_exists_action.throw_exception
117+
class: "My\Cms\AutoRoute\PathNotExists\ThrowException"
118+
scope: prototype
119+
tags:
120+
- { name: cmf_routing_auto.provider, alias: "throw_exception"}
115121
116122
.. code-block:: xml
117123
124+
<!-- app/config/config.xml -->
118125
<service
119126
id="my_cms.not_exists_action.throw_exception"
120127
class="My\Cms\AutoRoute\PathNotExists\ThrowException"
@@ -125,6 +132,7 @@ It is registered in the DI configuration as follows:
125132
126133
.. code-block:: php
127134
135+
// app/config/config.php
128136
use Symfony\Component\DependencyInjection\Definition;
129137
130138
$definition = new Definition('My\Cms\AutoRoute\PathNotExists\ThrowException');

0 commit comments

Comments
 (0)