This repository was archived by the owner on Sep 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 156
add MenuOptionsInterface docs #536
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,6 +121,108 @@ configuration in the ``sonata_admin`` section of your project configuration: | |
|
||
See the `Sonata Admin extension documentation`_ for more information. | ||
|
||
MenuOptionInterface Sonata Admin Extension | ||
------------------------------------------------- | ||
|
||
This bundle provides an extension that allows user to edit different menu options using the Sonata admin interface. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should wrap lines after the first word that crosses the 72th character. |
||
|
||
To enable the extensions in your admin classes, simply define the extension configuration in the ``sonata_admin`` section of your project configuration: | ||
|
||
.. configuration-block:: | ||
|
||
.. code-block:: yaml | ||
|
||
# app/config/config.yml | ||
sonata_admin: | ||
# ... | ||
extensions: | ||
cmf_menu.admin_extension.menu_options: | ||
implements: | ||
- Symfony\Cmf\Bundle\MenuBundle\Model\MenuOptionsInterface | ||
|
||
.. code-block:: xml | ||
|
||
<!-- app/config/config.xml --> | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container xmlns="http://cmf.symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<config xmlns="http://sonata-project.org/schema/dic/admin"> | ||
<!-- ... --> | ||
<extension id="cmf_menu.admin_extension.menu_options"> | ||
<implement>Symfony\Cmf\Bundle\MenuBundle\Model\MenuOptionsInterface</implement> | ||
</extension> | ||
</config> | ||
</container> | ||
|
||
.. code-block:: php | ||
|
||
// app/config/config.php | ||
$container->loadFromExtension('sonata_admin', array( | ||
'extensions' => array( | ||
'cmf_menu.admin_extension.menu_options' => array( | ||
'implements' => array( | ||
'Symfony\Cmf\Bundle\MenuBundle\Model\MenuOptionsInterface', | ||
), | ||
), | ||
), | ||
)); | ||
|
||
See the `Sonata Admin extension documentation`_ for more information. | ||
|
||
These are the list of available options: | ||
|
||
Display | ||
Display children | ||
Menu attributes (advanced) | ||
Label attributes (advanced) | ||
Children attributes (advanced) | ||
Link attributes (advanced) | ||
|
||
See the `KnpMenuBundle documentation`_ for more information about these attributes. | ||
|
||
By default the only available options are **Display** and **Display Children**. To enable the advaned options you need to add ``burgov/key-value-form-bundle`` requirement in your ``composer.json`` and enable the advanced options in your config file: | ||
|
||
.. configuration-block:: | ||
|
||
.. code-block:: yaml | ||
|
||
# app/config/config.yml | ||
cmf_menu: | ||
admin_extensions: | ||
menu_options: | ||
advanced: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should also have an XML and PHP example: <!-- app/config/config.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://cmf.symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<config xmlns="http://cmf.symfony.com/schema/dic/menu">
<admin-extensions>
<menu-options advanced="true">
</admin-extensions>
</config>
</container> PHP: // app/config/config.php
$container->loadFromExtension('cmf_menu', array(
'admin_extensions' => array(
'menu_options' => array(
'advanced' => true,
),
),
)); |
||
|
||
|
||
.. code-block:: xml | ||
|
||
<!-- app/config/config.xml --> | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container xmlns="http://cmf.symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<config xmlns="http://cmf.symfony.com/schema/dic/menu"> | ||
<admin-extensions> | ||
<menu-options advanced="true"> | ||
</admin-extensions> | ||
</config> | ||
|
||
</container> | ||
|
||
.. code-block:: php | ||
|
||
// app/config/config.php | ||
$container->loadFromExtension('cmf_menu', array( | ||
'admin_extensions' => array( | ||
'menu_options' => array( | ||
'advanced' => true, | ||
), | ||
), | ||
)); | ||
|
||
.. _`Sonata Admin extension documentation`: http://sonata-project.org/bundles/admin/master/doc/reference/extensions.html | ||
.. _SonataDoctrinePHPCRAdminBundle: http://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/index.html | ||
.. _`configuring sonata admin`: http://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/reference/configuration.html | ||
.. _`KnpMenuBundle documentation`: http://github.com/KnpLabs/KnpMenu/blob/master/doc/01-Basic-Menus.markdown#menu-attributes |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the tag line (the line containing
-
) should be as long as the headline (the line containing the text of the headline). In this case, you have to remove some-
's.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know exactly what you mean but I'll remove it :)