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

Commit b586f62

Browse files
committed
[#744] Some minor formatting
1 parent 9c92396 commit b586f62

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

bundles/routing/dynamic_customize.rst

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,24 @@ implementations if you have a case not handled by the
3636
{
3737
public function enhance(array $defaults, Request $request)
3838
{
39-
// own logic.
39+
// ... customize the $defaults array
4040
41-
// Enhancer MUST return the $defaults but may add or remove values.
4241
return $defaults;
4342
}
4443
}
4544
46-
47-
Simply define services for your enhancers and tag them with ``dynamic_router_route_enhancer`` to have
48-
them added to the routing. You can specify an optional ``priority`` parameter
49-
on the tag to control the order in which enhancers are executed. The higher the
50-
priority, the earlier the enhancer is executed.
45+
Simply define services for your enhancers and tag them with
46+
``dynamic_router_route_enhancer`` to have them added to the routing. You can
47+
specify an optional ``priority`` parameter on the tag to control the order in
48+
which enhancers are executed. The higher the priority, the earlier the enhancer
49+
is executed.
5150

5251
.. configuration-block::
5352

5453
.. code-block:: yaml
5554
5655
services:
57-
app.routing.enhancer.simple:
56+
app.routing.simple_enhancer:
5857
class: AppBundle\Routing\Enhancer\SimpleEnhancer
5958
tags:
6059
- { name: dynamic_router_route_enhancer, priority: 10 }
@@ -67,7 +66,7 @@ priority, the earlier the enhancer is executed.
6766
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
6867
6968
<services>
70-
<service id="app.routing.enhancer.simple" class="AppBundle\Routing\Enhancer\SimpleEnhancer">
69+
<service id="app.routing.simple_enhancer" class="AppBundle\Routing\Enhancer\SimpleEnhancer">
7170
<tag name="dynamic_router_route_enhancer" priority="10" />
7271
</service>
7372
</services>
@@ -78,8 +77,11 @@ priority, the earlier the enhancer is executed.
7877
use Symfony\Component\DependencyInjection\Definition;
7978
8079
$definition = new Definition('AppBundle\Routing\Enhancer\SimpleEnhancer');
81-
$definition->addTag('dynamic_router_route_enhancer',array('priority' => 10));
82-
$container->setDefinition('app.routing.enhancer.simple', $definition);
80+
$definition->addTag('dynamic_router_route_enhancer', array(
81+
'priority' => 10,
82+
));
83+
84+
$container->setDefinition('app.routing.simple_enhancer', $definition);
8385
8486
.. index:: Route Provider
8587

0 commit comments

Comments
 (0)