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

Commit de02ae0

Browse files
committed
Merge branch '1.0' into 1.1
Conflicts: bundles/routing/dynamic_customize.rst quick_tour/the_model.rst
2 parents 40c2f71 + b586f62 commit de02ae0

File tree

5 files changed

+71
-15
lines changed

5 files changed

+71
-15
lines changed

bundles/block/types.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ configuration.
5353
# app/config/config.yml
5454
sonata_admin:
5555
extensions:
56-
cmf.block.admin.base.extension:
56+
cmf_block.admin_extension.cache:
5757
extends:
58-
- Symfony\Cmf\Bundle\BlockBundle\Model\BaseBlock
58+
- Symfony\Cmf\Bundle\BlockBundle\Model\AbstractBlock
5959
6060
.. code-block:: xml
6161
@@ -65,8 +65,8 @@ configuration.
6565
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
6666
6767
<config xmlns="http://sonata-project.org/schema/dic/admin">
68-
<extension id="cmf.block.admin.base.extension">
69-
<extend>Symfony\Cmf\Bundle\BlockBundle\Model\BaseBlock</extend>
68+
<extension id="cmf_block.admin_extension.cache">
69+
<extend>Symfony\Cmf\Bundle\BlockBundle\Model\AbstractBlock</extend>
7070
</extension>
7171
</config>
7272
</container>
@@ -76,9 +76,9 @@ configuration.
7676
// app/config/config.php
7777
$container->loadFromExtension('sonata_admin', array(
7878
'extensions' => array(
79-
'cmf.block.admin.base.extension' => array(
79+
'cmf.block.admin_extension.cache' => array(
8080
'extends' => array(
81-
'Symfony\Cmf\Bundle\BlockBundle\Model\BaseBlock',
81+
'Symfony\Cmf\Bundle\BlockBundle\Model\AbstractBlock',
8282
),
8383
),
8484
),

bundles/map.rst.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ library or they introduce a complete new concept.
4747
* :doc:`routing/dynamic`
4848
* :doc:`routing/dynamic_customize`
4949

50-
* :doc:`routing_auto/index`
50+
* :doc:`routing_auto/index` (in development)
5151

5252
* :doc:`routing_auto/introduction`
5353
* :doc:`routing_auto/providers`
@@ -77,7 +77,7 @@ show a different way of implementing a concept. You can use these bundles in
7777
your project, but you can also get ideas from these bundles to create your own
7878
bundle based on the key bundles.
7979

80-
* **BlogBundle**
80+
* **BlogBundle** (in development)
8181

8282
* :doc:`blog`
8383

bundles/routing/dynamic_customize.rst

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,69 @@ Writing your own Route Enhancers
2222

2323
You can add your own :ref:`RouteEnhancerInterface <bundles-routing-dynamic_router-enhancer>`
2424
implementations if you have a case not handled by the
25-
:ref:`provided enhancers <component-routing-enhancers>`. Simply define services
26-
for your enhancers and tag them with ``dynamic_router_route_enhancer`` to have
27-
them added to the routing. You can specify an optional ``priority`` parameter
28-
on the tag to control the order in which enhancers are executed. The higher the
29-
priority, the earlier the enhancer is executed.
25+
:ref:`provided enhancers <component-routing-enhancers>`.
26+
27+
.. code-block:: php
28+
29+
// src/AppBundle/Routing/Enhancer/SimpleEnhancer.php
30+
namespace AppBundle\Routing\Enhancer;
31+
32+
use Symfony\Cmf\Component\Routing\Enhancer\RouteEnhancerInterface;
33+
use Symfony\Component\HttpFoundation\Request;
34+
35+
class SimpleEnhancer implements RouteEnhancerInterface
36+
{
37+
public function enhance(array $defaults, Request $request)
38+
{
39+
// ... customize the $defaults array
40+
41+
return $defaults;
42+
}
43+
}
44+
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.
50+
51+
.. configuration-block::
52+
53+
.. code-block:: yaml
54+
55+
services:
56+
app.routing.simple_enhancer:
57+
class: AppBundle\Routing\Enhancer\SimpleEnhancer
58+
tags:
59+
- { name: dynamic_router_route_enhancer, priority: 10 }
60+
61+
.. code-block:: xml
62+
63+
<?xml version="1.0" encoding="UTF-8" ?>
64+
<container xmlns="http://symfony.com/schema/dic/services"
65+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
66+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
67+
68+
<services>
69+
<service id="app.routing.simple_enhancer" class="AppBundle\Routing\Enhancer\SimpleEnhancer">
70+
<tag name="dynamic_router_route_enhancer" priority="10" />
71+
</service>
72+
</services>
73+
</container>
74+
75+
.. code-block:: php
76+
77+
use Symfony\Component\DependencyInjection\Definition;
78+
79+
$definition = new Definition('AppBundle\Routing\Enhancer\SimpleEnhancer');
80+
$definition->addTag('dynamic_router_route_enhancer', array(
81+
'priority' => 10,
82+
));
83+
84+
$container->setDefinition('app.routing.simple_enhancer', $definition);
3085
3186
.. index:: Route Provider
87+
3288
.. _bundle-routing-custom_provider:
3389

3490
Using a Custom Route Provider

bundles/tree_browser/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Installation
1818
------------
1919

2020
You can install this bundle `with composer`_ using the
21-
``symfony-cmf/seo-content-bundle`` package on `Packagist`_.
21+
``symfony-cmf/tree-browser-bundle`` package on `Packagist`_.
2222

2323
Both the CmfTreeBrowserBundle and FOSJsRoutingBundle_ must be registered in the
2424
``AppKernel``::

quick_tour/the_model.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ dump command.
6363
.. note::
6464

6565
Previously, the PHPCR tree was compared with a Filesystem. While this
66-
gives you a good imagine of what happends, it's not the truth. You can
66+
gives you a good image of what happens, it's not the truth. You can
6767
better compare it to an XML file, where each node is an element and its
6868
properties are attributes.
6969

0 commit comments

Comments
 (0)