|
| 1 | +.. index:: |
| 2 | + single: Sonata; Bundles |
| 3 | + single: SonataPhpcrAdminIntegrationBundle |
| 4 | + |
| 5 | +SonataPhpcrAdminIntegrationBundle |
| 6 | +============================ |
| 7 | + |
| 8 | + The SonataPhpcrAdminIntegrationBundle provides admin services for the Sonata |
| 9 | + Admin tool. Additionally, it provides admin extensions to improve your |
| 10 | + custom admin services. |
| 11 | + |
| 12 | +Installation |
| 13 | +------------ |
| 14 | + |
| 15 | +You can install this bundle `with composer`_ using the |
| 16 | +``symfony-cmf/sonata-phpcr-admin-integration-bundle`` package on Packagist_. |
| 17 | + |
| 18 | +As this bundle integrates the SonataDoctrinePhpcrAdminBundle_, please follow |
| 19 | +`its official installation guide`_ to install the bundle. |
| 20 | + |
| 21 | +After this, enable both the CmfSonataPhpcrAdminIntegrationBundle as well as the |
| 22 | +SonataDoctrinePhpcrAdminBundle related bundles:: |
| 23 | + |
| 24 | + // app/appKernel.php |
| 25 | + |
| 26 | + // ... |
| 27 | + public function registerBundles() |
| 28 | + { |
| 29 | + $bundles = array( |
| 30 | + // ... |
| 31 | + |
| 32 | + // SonataAdminBundle related |
| 33 | + new Sonata\CoreBundle\SonataCoreBundle(), |
| 34 | + new Sonata\BlockBundle\SonataBlockBundle(), |
| 35 | + new Knp\Bundle\MenuBundle\KnpMenuBundle(), |
| 36 | + new Sonata\AdminBundle\SonataAdminBundle(), |
| 37 | + |
| 38 | + // SonataDoctrinePhpcrAdminBundle related |
| 39 | + new Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle(), |
| 40 | + new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(), |
| 41 | + |
| 42 | + // CmfSonataPhpcrAdminIntegrationBundle |
| 43 | + new Symfony\Cmf\Bundle\SonataPhpcrAdminIntegrationBundle\CmfSonataPhpcrAdminIntegrationBundle(), |
| 44 | + ); |
| 45 | + |
| 46 | + // ... |
| 47 | + |
| 48 | + return $bundles; |
| 49 | + } |
| 50 | + |
| 51 | +Usage |
| 52 | +----- |
| 53 | + |
| 54 | +The integration bundle provides admins for the CMF bundles. The related |
| 55 | +configuration section of a bundle becomes available whenever a CMF bundle is |
| 56 | +registered in the ``AppKernel``. For instance, to enable the admin integration |
| 57 | +for the :doc:`CmfContentBundle <../content/introduction>`, use the following |
| 58 | +config: |
| 59 | + |
| 60 | +.. configuration-block:: |
| 61 | + |
| 62 | + .. code-block:: yaml |
| 63 | +
|
| 64 | + # app/config/config.yml |
| 65 | + cmf_sonata_phpcr_admin_integration: |
| 66 | + bundles: |
| 67 | + content: ~ |
| 68 | +
|
| 69 | + .. code-block:: xml |
| 70 | +
|
| 71 | + <!-- app/config/config.xml --> |
| 72 | + <?xml version="2.0" encoding="UTF-8" ?> |
| 73 | + <container xmlns="http://symfony.com/schema/dic/services" |
| 74 | + xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" |
| 75 | + xsd:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd |
| 76 | + http://cmf.symfony.com/schema/dic/sonata_admin_integration http://cmf.symfony.com/schema/dic/sonata_admin_integration/sonata_admin_integration.xsd" |
| 77 | + > |
| 78 | +
|
| 79 | + <config xmlns="http://cmf.symfony.com/schema/dic/sonata_admin_integration"> |
| 80 | + <bundles> |
| 81 | + <content/> |
| 82 | + </bundles> |
| 83 | + </config> |
| 84 | + </container> |
| 85 | +
|
| 86 | + .. code-block:: php |
| 87 | +
|
| 88 | + // app/config/config.php |
| 89 | + $container->loadFromExtension('cmf_sonata_phpcr_admin_integration', [ |
| 90 | + 'bundles' => [ |
| 91 | + 'content' => true, |
| 92 | + ], |
| 93 | + ]); |
| 94 | +
|
| 95 | +Configuration |
| 96 | +------------- |
| 97 | + |
| 98 | +This section documents all available admin integrations in this bundle, with |
| 99 | +their configuration options. |
| 100 | + |
| 101 | +Block |
| 102 | +~~~~~ |
| 103 | + |
| 104 | +Content |
| 105 | +~~~~~~~ |
| 106 | + |
| 107 | +This integration becomes available once the :doc:`CmfContentBundle |
| 108 | +<../content/introduction>` is installed. This will provide an admin interface |
| 109 | +for the ``StaticContent`` document. Enable this admin using: |
| 110 | + |
| 111 | +.. configuration-block:: |
| 112 | + |
| 113 | + .. code-block:: yaml |
| 114 | +
|
| 115 | + # app/config/config.yml |
| 116 | + cmf_sonata_phpcr_admin_integration: |
| 117 | + bundles: |
| 118 | + content: ~ |
| 119 | +
|
| 120 | + .. code-block:: xml |
| 121 | +
|
| 122 | + <!-- app/config/config.xml --> |
| 123 | + <?xml version="2.0" encoding="UTF-8" ?> |
| 124 | + <container xmlns="http://symfony.com/schema/dic/services" |
| 125 | + xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" |
| 126 | + xsd:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd |
| 127 | + http://cmf.symfony.com/schema/dic/sonata_admin_integration http://cmf.symfony.com/schema/dic/sonata_admin_integration/sonata_admin_integration.xsd" |
| 128 | + > |
| 129 | +
|
| 130 | + <config xmlns="http://cmf.symfony.com/schema/dic/sonata_admin_integration"> |
| 131 | + <bundles> |
| 132 | + <content/> |
| 133 | + </bundles> |
| 134 | + </config> |
| 135 | + </container> |
| 136 | +
|
| 137 | + .. code-block:: php |
| 138 | +
|
| 139 | + // app/config/config.php |
| 140 | + $container->loadFromExtension('cmf_sonata_phpcr_admin_integration', [ |
| 141 | + 'bundles' => [ |
| 142 | + 'content' => true, |
| 143 | + ], |
| 144 | + ]); |
| 145 | +
|
| 146 | +.. tip:: |
| 147 | + |
| 148 | + Install the IvoryCKEditorBundle_ to enable a CKEditor to edit the content |
| 149 | + body: |
| 150 | + |
| 151 | + .. code-block:: bash |
| 152 | +
|
| 153 | + $ composer require egeloen/ckeditor-bundle |
| 154 | +
|
| 155 | +Core |
| 156 | +~~~~ |
| 157 | + |
| 158 | +Menu |
| 159 | +~~~~ |
| 160 | + |
| 161 | +Routing |
| 162 | +~~~~~~~ |
| 163 | + |
| 164 | +RoutingAuto |
| 165 | +~~~~~~~~~~~ |
| 166 | + |
| 167 | +Seo |
| 168 | +~~~ |
| 169 | + |
| 170 | +Learn More |
| 171 | +---------- |
| 172 | + |
| 173 | +* SonataAdminBundle_ |
| 174 | +* SonataDoctrinePhpcrAdminBundle_ |
| 175 | +* :doc:`The Sonata Admin chapter of the tutorial <../../tutorial/sonata-admin>` |
| 176 | + |
| 177 | +.. _`with composer`: https://getcomposer.org |
| 178 | +.. _`Packagist`: https://packagist.org/packages/symfony-cmf/sonata-admin-integration-bundle |
| 179 | +.. _SonataDoctrinePhpcrAdminBundle: https://sonata-project.org/bundles/doctrine-phpcr-admin/1-x/doc/index.html |
| 180 | +.. _its official installation guide: https://sonata-project.org/bundles/doctrine-phpcr-admin/1-x/doc/reference/installation.html |
| 181 | +.. _SonataAdminBundle: https://sonata-project.org/bundles/admin/3-x/doc/index.html |
0 commit comments