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

Added documentation for Sonata FrontendLinkExtension #610

Merged
merged 3 commits into from
Nov 15, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions bundles/routing/dynamic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,53 @@ configuration in the ``sonata_admin`` section of your project configuration:

See the `Sonata Admin extension documentation`_ for more information.

FrontendLink Sonata Admin Extension
----------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this title line should have the same amount of characters as the title text.


This bundle provides an extension to show a button in Sonata Admin, which links on the actual
frontend representation of a document. Documents which implement the ``RouteReferrersReadInterface``
and Routes itself (``Symfony\Component\Routing\Route``) are supported.

To enable the extension 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_routing.admin_extension.frontend_link:
implements:
- Symfony\Cmf\Component\Routing\RouteReferrersReadInterface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add

extends:
    - Symfony\Component\Routing\Route 

here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done...


.. code-block:: xml

<!-- app/config/config.xml -->
<config xmlns="http://sonata-project.org/schema/dic/admin">
<!-- ... -->
<extension id="cmf_routing.admin_extension.frontend_link">
<implement>Symfony\Cmf\Component\Routing\RouteReferrersReadInterface</implement>
</extension>
</config>

.. code-block:: php

// app/config/config.php
$container->loadFromExtension('sonata_admin', array(
'extensions' => array(
'cmf_routing.admin_extension.frontend_link' => array(
'implements' => array(
'Symfony\Cmf\Component\Routing\RouteReferrersReadInterface',
),
),
),
));

See the `Sonata Admin extension documentation`_ for more information.

Customize the DynamicRouter
---------------------------

Expand Down