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

Commit 2eca693

Browse files
committed
Updated other articles
1 parent cd994e8 commit 2eca693

File tree

3 files changed

+18
-40
lines changed

3 files changed

+18
-40
lines changed

book/structuring_content.rst

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -105,36 +105,29 @@ rendered by the ``MenuFactory``.
105105
The Factory
106106
...........
107107

108-
The ``ContentAwareFactory`` is a ``FactoryInterface`` implementation, which
109-
generates the full ``MenuItem`` hierarchy from the provided MenuNode. The data
110-
generated this way is later used to generate the actual HTML representation of
111-
the menu.
108+
Menu factories generate the full ``MenuItem`` hierarchy from the provided
109+
MenuNode. The data generated this way is later used to generate the actual HTML
110+
representation of the menu.
112111

113112
The included implementation focuses on generating ``MenuItem`` instances from
114113
``NodeInterface`` instances, as this is usually the best approach to handle
115114
tree-like structures typically used by a CMS. Other approaches are implemented in
116-
the base classes, and their respective documentation pages can be found in
115+
the base classes and their respective documentation pages can be found in
117116
KnpMenuBundle_'s page.
118117

119-
``ContentAwareFactory`` is responsible for loading the full menu hierarchy and
120-
transforming the ``MenuNode`` instances from the root node it receives from
121-
the ``MenuProviderInterface`` implementation. It is also responsible for
122-
determining which (if any) menu item is currently being viewed by the user.
123-
It supports a voter mechanism to have custom code decide what menu item is
124-
the current item.
125-
``KnpMenu`` already includes a specific factory targeted at Symfony2's Routing
126-
component, which this bundle extends, to add support for:
127-
128-
* ``Route`` instances stored in a database (refer to :ref:`RoutingBundle's
129-
RouteProvider <start-routing-getting-route-object>` for more details on
130-
this)
118+
``KnpMenu`` already includes a specific factory targeted at the Symfony Routing
119+
component to add support for:
120+
121+
* ``Route`` instances stored in a database (refer to
122+
:ref:`RoutingBundle's RouteProvider <start-routing-getting-route-object>` for
123+
more details on this)
131124
* ``Route`` instances with associated content (more on this on respective
132125
:ref:`RoutingBundle's section <start-routing-linking-a-route-with-a-model-instance>`)
133126

134-
As mentioned before, ``ContentAwareFactory`` is responsible for loading
135-
all the menu nodes from the provided root element. The actual loaded nodes can
136-
be of any class, even if it's different from the root's, but all must
137-
implement ``NodeInterface`` in order to be included in the generated menu.
127+
As mentioned before, the factory is responsible for loading all the menu nodes
128+
from the provided root element. The actual loaded nodes can be of any class,
129+
even if it's different from the root's, but all must implement
130+
``NodeInterface`` in order to be included in the generated menu.
138131

139132
The Menu Nodes
140133
..............

tutorial/getting-started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ all of the required packages now.
3232
require: {
3333
...
3434
"symfony-cmf/routing-auto-bundle": "~1.0",
35-
"symfony-cmf/menu-bundle": "~1.2",
35+
"symfony-cmf/menu-bundle": "~2.0",
3636
"sonata-project/doctrine-phpcr-admin-bundle": "~1.2",
3737
"symfony-cmf/tree-browser-bundle": "~1.1",
3838
"doctrine/data-fixtures": "~1.0",

tutorial/the-frontend.rst

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,6 @@ configuration:
190190
- '@cmf_menu.loader.node'
191191
- '@doctrine_phpcr'
192192
- /cms/pages
193-
calls:
194-
- [setRequest, ["@?request="]]
195193
tags:
196194
- { name: knp_menu.provider }
197195
@@ -209,18 +207,12 @@ configuration:
209207
<!-- ... -->
210208
<service
211209
id="acme.basic_cms.menu_provider"
212-
class="Symfony\Cmf\Bundle\MenuBundle\Provider\PhpcrMenuProvider">
210+
class="Symfony\Cmf\Bundle\MenuBundle\Provider\PhpcrMenuProvider"
211+
>
213212
<argument type="service" id="cmf_menu.loader.node"/>
214213
<argument type="service" id="doctrine_phpcr"/>
215214
<argument>/cms/pages</argument>
216-
<call method="setRequest">
217-
<argument
218-
type="service"
219-
id="request"
220-
on-invalid="null"
221-
strict="false"
222-
/>
223-
</call>
215+
224216
<tag name="knp_menu.provider" />
225217
</service>
226218
</services>
@@ -240,13 +232,6 @@ configuration:
240232
->addArgument(new Reference('cmf_menu.loader.node'))
241233
->addArgument(new Reference('doctrine_phpcr'))
242234
->addArgument('/cms/pages')
243-
->addMethodCall('setRequest', array(
244-
new Reference(
245-
'request',
246-
ContainerInterface::NULL_ON_INVALID_REFERENCE,
247-
false
248-
)
249-
))
250235
->addTag('knp_menu.provider')
251236
;
252237

0 commit comments

Comments
 (0)