-
Notifications
You must be signed in to change notification settings - Fork 156
restructured CoreBundle docs #270
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
.. index:: | ||
single: Dependency Injection Tags; CoreBundle | ||
|
||
Dependency Injection Tags | ||
------------------------- | ||
|
||
cmf_request_aware | ||
~~~~~~~~~~~~~~~~~ | ||
|
||
If you have services that need the request (e.g. for the publishing workflow | ||
or current menu item voters), you can tag them with ``cmf_request_aware`` to | ||
have a kernel listener inject the request. Any class used in such a tagged | ||
service must have the ``setRequest`` method or you will get a fatal error:: | ||
|
||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class MyClass | ||
{ | ||
private $request; | ||
|
||
public function setRequest(Request $request) | ||
{ | ||
$this->request = $request; | ||
} | ||
} | ||
|
||
.. caution:: | ||
|
||
You should only use this tag on services that will be needed on every | ||
request. If you use this tag excessively you will run into performance | ||
issues. For seldom used services, you can inject the container in the | ||
service definition and call ``$this->container->get('request')`` in your | ||
code when you actually need the request. | ||
|
||
For Symfony 2.3, this tag is automatically translated to a | ||
`synchronized service`_ but Symfony 2.2 does not have that feature, so you can | ||
use this tag for bundles that you want to be able to work with Symfony 2.2. In | ||
custom applications that run with Symfony 2.3, there is no need for this tag, | ||
just use the synchronized service feature. | ||
|
||
cmf_published_voter | ||
~~~~~~~~~~~~~~~~~~~ | ||
|
||
Used to activate :ref:`custom voters <bundle-core-workflow_custom_voters>` for the | ||
:ref:`publish workflow <bundle-core-publish_workflow>`. Tagging a service with | ||
``cmf_published_voter`` integrates it into the access decision of the publish | ||
workflow. | ||
|
||
This tag has the attribute ``priority``. The lower the priority number, the | ||
earlier the voter gets to vote. | ||
|
||
.. _`synchronized service`: http://symfony.com/doc/current/cookbook/service_container/scopes.html#using-a-synchronized-service |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CoreBundle | ||
========== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
introduction | ||
publish_workflow | ||
dependency_injection_tags | ||
templating | ||
multilang |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.. index:: | ||
single: Core; Bundles | ||
|
||
CoreBundle | ||
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. .. index::
single: Core; Bundles 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. fixed |
||
========== | ||
|
||
This bundle provides common functionality, helpers and utilities for the | ||
other CMF bundles. | ||
|
||
One of the provided features is an interface and implementation of a publish | ||
workflow checker with an accompanying interface that models can implement if | ||
they want to support this checker. | ||
|
||
Furthermore, it provides a twig helper exposing several useful functions for | ||
twig templates to interact with PHPCR-ODM documents. | ||
|
||
Finally, most of its configuration settings are automatically applied as | ||
defaults for most of the other CMF Bundles. | ||
|
||
Installation | ||
------------ | ||
|
||
You can install the bundle in 2 different ways: | ||
|
||
* Use the official Git repository (https://github.com/symfony-cmf/CoreBundle); | ||
* Install it via Composer (``symfony-cmf/core-bundle`` on `Packagist`_). | ||
|
||
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 may missed my comment, or you are working on it, but I like to have something like: Sections
--------
* :doc:`...`
* :doc:`...` 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. good now? 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. yes! |
||
Sections | ||
-------- | ||
|
||
* :doc:`publish_workflow` | ||
* :doc:`dependency_injection_tags` | ||
* :doc:`templating` | ||
* :doc:`multilang` | ||
|
||
.. _`Packagist`: https://packagist.org/packages/symfony-cmf/core-bundle |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.. index:: | ||
single: Multi-Language; CoreBundle | ||
|
||
Multi-language support | ||
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. .. index::
single: Multi-Language; CoreBundle 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. fixed |
||
---------------------- | ||
|
||
Editing Locale Information: Translatable Sonata Admin Extension | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Several bundles provide translatable model classes that implement | ||
``TranslatableInterface``. This extension adds a locale field | ||
to the given SonataAdminBundle forms. | ||
|
||
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_core.admin_extension.translatable: | ||
implements: | ||
- Symfony\Cmf\Bundle\CoreBundle\Translatable\TranslatableInterface | ||
|
||
.. code-block:: xml | ||
|
||
<!-- app/config/config.xml --> | ||
<?xml version="1.0" charset="UTF-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services"> | ||
|
||
<config xmlns="http://sonata-project.org/schema/dic/admin"> | ||
<!-- ... --> | ||
<extension id="cmf_core.admin_extension.translatable"> | ||
<implement> | ||
Symfony\Cmf\Bundle\CoreBundle\Translatable\TranslatableInterface | ||
</implement> | ||
</extension> | ||
</config> | ||
|
||
</container> | ||
|
||
.. code-block:: php | ||
|
||
// app/config/config.php | ||
$container->loadFromExtension('sonata_admin', array( | ||
// ... | ||
'extensions' => array( | ||
'cmf_core.admin_extension.translatable' => array( | ||
'implements' => array( | ||
'Symfony\Cmf\Bundle\CoreBundle\Translatable\TranslatableInterface', | ||
), | ||
), | ||
), | ||
)); | ||
|
||
See the `Sonata Admin extension documentation`_ for more information. | ||
|
||
.. _`Sonata Admin extension documentation`: http://sonata-project.org/bundles/admin/master/doc/reference/extensions.html |
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.
please add an index directive:
.. index:: single: Dependency Injection Tags; CoreBundle
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.
fixed