@@ -121,6 +121,114 @@ configuration in the ``sonata_admin`` section of your project configuration:
121
121
122
122
See the `Sonata Admin extension documentation `_ for more information.
123
123
124
+ MenuOptionInterface Sonata Admin Extension
125
+ ------------------------------------------
126
+
127
+ This bundle provides an extension that allows user to edit different menu
128
+ options using the Sonata admin interface.
129
+
130
+ To enable the extensions in your admin classes, simply define the extension
131
+ configuration in the ``sonata_admin `` section of your project configuration:
132
+
133
+ .. configuration-block ::
134
+
135
+ .. code-block :: yaml
136
+
137
+ # app/config/config.yml
138
+ sonata_admin :
139
+ # ...
140
+ extensions :
141
+ cmf_menu.admin_extension.menu_options :
142
+ implements :
143
+ - Symfony\Cmf\Bundle\MenuBundle\Model\MenuOptionsInterface
144
+
145
+ .. code-block :: xml
146
+
147
+ <!-- app/config/config.xml -->
148
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
149
+ <container xmlns =" http://cmf.symfony.com/schema/dic/services"
150
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
151
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd" >
152
+
153
+ <config xmlns =" http://sonata-project.org/schema/dic/admin" >
154
+ <!-- ... -->
155
+ <extension id =" cmf_menu.admin_extension.menu_options" >
156
+ <implement >Symfony\Cmf\Bundle\MenuBundle\Model\MenuOptionsInterface</implement >
157
+ </extension >
158
+ </config >
159
+ </container >
160
+
161
+ .. code-block :: php
162
+
163
+ // app/config/config.php
164
+ $container->loadFromExtension('sonata_admin', array(
165
+ 'extensions' => array(
166
+ 'cmf_menu.admin_extension.menu_options' => array(
167
+ 'implements' => array(
168
+ 'Symfony\Cmf\Bundle\MenuBundle\Model\MenuOptionsInterface',
169
+ ),
170
+ ),
171
+ ),
172
+ ));
173
+
174
+ See the `Sonata Admin extension documentation `_ for more information.
175
+
176
+ These are the list of available options:
177
+
178
+ * Display;
179
+ * Display children;
180
+ * Menu attributes (advanced);
181
+ * Label attributes (advanced);
182
+ * Children attributes (advanced);
183
+ * Link attributes (advanced).
184
+
185
+ See the `KnpMenuBundle documentation `_ for more information about these
186
+ attributes.
187
+
188
+ By default the only available options are **Display ** and **Display Children **.
189
+ To enable the advaned options you need to add ``burgov/key-value-form-bundle ``
190
+ requirement in your ``composer.json `` and enable the advanced options in
191
+ your config file:
192
+
193
+ .. configuration-block ::
194
+
195
+ .. code-block :: yaml
196
+
197
+ # app/config/config.yml
198
+ cmf_menu :
199
+ admin_extensions :
200
+ menu_options :
201
+ advanced : true
202
+
203
+
204
+ .. code-block :: xml
205
+
206
+ <!-- app/config/config.xml -->
207
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
208
+ <container xmlns =" http://cmf.symfony.com/schema/dic/services"
209
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
210
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd" >
211
+
212
+ <config xmlns =" http://cmf.symfony.com/schema/dic/menu" >
213
+ <admin-extensions >
214
+ <menu-options advanced =" true" >
215
+ </admin-extensions >
216
+ </config >
217
+
218
+ </container >
219
+
220
+ .. code-block :: php
221
+
222
+ // app/config/config.php
223
+ $container->loadFromExtension('cmf_menu', array(
224
+ 'admin_extensions' => array(
225
+ 'menu_options' => array(
226
+ 'advanced' => true,
227
+ ),
228
+ ),
229
+ ));
230
+
124
231
.. _`Sonata Admin extension documentation` : http://sonata-project.org/bundles/admin/master/doc/reference/extensions.html
125
232
.. _SonataDoctrinePHPCRAdminBundle : http://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/index.html
126
233
.. _`configuring sonata admin` : http://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/reference/configuration.html
234
+ .. _`KnpMenuBundle documentation` : http://github.com/KnpLabs/KnpMenu/blob/master/doc/01-Basic-Menus.markdown#menu-attributes
0 commit comments