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

Commit 9f740e1

Browse files
committed
Rewrote customization
1 parent c260fac commit 9f740e1

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

bundles/routing_auto/customization.rst

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ the route stack. For example, the following provider will add the path
2424
}
2525

2626
To use the path provider you must register it in the **DIC** and add the
27-
``cmf_routing_auto.provider`` tag and set the **alias** accordingly.
27+
``cmf_routing_auto.provider`` tag and set the **alias** accordingly:
2828

2929
.. configuration-block::
3030

@@ -56,14 +56,14 @@ To use the path provider you must register it in the **DIC** and add the
5656
5757
$container->setDefinition('my_cms.some_bundle.path_provider.foobar', $definition);
5858
59-
The **foobar** path provider is now available as **foobar**.
59+
The ``FoobarProvider`` is now available as **foobar** in the routing auto
60+
configuration.
6061

61-
.. note::
62+
.. caution::
6263

63-
The that both path providers and path actions need to be defined with a
64-
scope of "prototype". This ensures that each time the auto routing system
65-
requests the class a new one is given and we do not have any state
66-
problems.
64+
Both path providers and path actions need to be defined with a scope of
65+
"prototype". This ensures that each time the auto routing system requests
66+
the class a new one is given and you do not have any state problems.
6767

6868
Adding Path Actions
6969
~~~~~~~~~~~~~~~~~~~
@@ -77,7 +77,7 @@ registering your new class correctly in the DI configuration.
7777
This is a very simple implementation from the bundle - it is used to throw an
7878
exception when a path already exists::
7979

80-
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\PathNotExists;
80+
namespace Acme\MainBundle\RoutingAuto\PathNotExists;
8181

8282
use Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\PathActionInterface;
8383
use Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\Exception\CouldNotFindRouteException;
@@ -95,6 +95,9 @@ exception when a path already exists::
9595
}
9696
}
9797

98+
The ``init()`` method checks if the required options exists and saves the options
99+
in property. The ``execute()`` method executes the action.
100+
98101
It is registered in the DI configuration as follows:
99102

100103
.. configuration-block::
@@ -130,7 +133,11 @@ It is registered in the DI configuration as follows:
130133
Note the following:
131134

132135
* **Scope**: Must *always* be set to *prototype*;
133-
* **Tag**: The tag registers the service with the auto routing system, it can be one of the following;
134-
* ``cmf_routing_auto.exists.action`` - if the action is to be used when a path exists;
135-
* ``cmf_routing_auto.not_exists.action`` - if the action is to be used when a path does not exist;
136-
* **Alias**: The alias of the tag is the name by which you will reference this action in the auto routing schema.
136+
* **Tag**: The tag registers the service with the auto routing system, it can
137+
be one of the following:
138+
* ``cmf_routing_auto.exists.action`` - if the action is to be used when a
139+
path exists;
140+
* ``cmf_routing_auto.not_exists.action`` - if the action is to be used when
141+
a path does not exist;
142+
* **Alias**: The alias of the tag is the name by which you will reference this
143+
action in the auto routing configuration.

0 commit comments

Comments
 (0)