Skip to content

Commit

Permalink
Fix: Errors reported by DOCtor-RST
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark committed Jan 30, 2020
1 parent 4c41ebc commit 4aaa283
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 28 deletions.
12 changes: 5 additions & 7 deletions docs/reference/filter_field_definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,7 @@ Advanced usage
Filtering by sub entity properties
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you need to filter your base entities by the value of a sub entity property, you can simply use the dot-separated notation:

.. note::

This only makes sense when the prefix path is made of entities, not collections.

.. code-block:: php
If you need to filter your base entities by the value of a sub entity property, you can simply use the dot-separated notation::

namespace App\Admin;

Expand All @@ -167,6 +161,10 @@ If you need to filter your base entities by the value of a sub entity property,
}
}

.. note::

This only makes sense when the prefix path is made of entities, not collections.

Label
^^^^^

Expand Down
16 changes: 7 additions & 9 deletions docs/reference/form_field_definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,7 @@ This placeholder is translated using the ``SonataAdminBundle`` catalog.
Advanced usage: File management
-------------------------------

If you want to use custom types from the Form framework you must use the ``addType`` method.

.. note::

The ``add`` method uses the information provided by the model definition.

.. code-block:: php
If you want to use custom types from the Form framework you must use the ``addType`` method::

namespace Sonata\MediaBundle\Admin;

Expand All @@ -129,6 +123,10 @@ If you want to use custom types from the Form framework you must use the ``addTy
}
}

.. note::

The ``add`` method uses the information provided by the model definition.

.. note::

By setting ``type=false`` in the file definition, the Form framework will provide an instance of
Expand All @@ -144,7 +142,7 @@ The AdminBundle provides 2 options:
* ``Sonata\AdminBundle\Form\Type\ModelType``: the ``User`` list is set in a select widget with an `Add` button to create a new ``User``,
* ``Sonata\AdminBundle\Form\Type\ModelListType``: the ``User`` list is set in a model where you can search, select and delete a ``User``.

.. code-block:: php
The following example shows both types in action::

namespace Sonata\NewsBundle\Admin;

Expand Down Expand Up @@ -197,7 +195,7 @@ You can easily add a new ``Media`` row by defining one of these options:
* ``sortable``: if the model has a position field, you can enable a drag and drop sortable effect by setting ``sortable=field_name``.
* ``limit``: ``<an integer>`` if defined, limits the number of elements that can be added, after which the "Add new" button will not be displayed

.. code-block:: php
The following example shows the ``CollectionType`` in action::

namespace Sonata\MediaBundle\Admin;

Expand Down
16 changes: 6 additions & 10 deletions docs/reference/list_field_definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ If no type is set, the ``Admin`` class will use the type defined in the Doctrine
List actions
------------

You can set actions for the list items by adding an '_action' field in ``configureListFields``:

.. code-block:: php
You can set actions for the list items by adding an '_action' field in ``configureListFields``::

$listMapper
->add('_action', 'actions', []
Expand Down Expand Up @@ -125,13 +123,7 @@ Advance Usage
Displaying sub entity properties
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you need to display only one field from a sub entity or embedded object in a dedicated column, you can simply use the dot-separated notation:

.. note::

This only makes sense when the prefix path is made of entities, not collections.

.. code-block:: php
If you need to display only one field from a sub entity or embedded object in a dedicated column, you can simply use the dot-separated notation::

namespace App\Admin;

Expand All @@ -156,6 +148,10 @@ If you need to display only one field from a sub entity or embedded object in a
}
}

.. note::

This only makes sense when the prefix path is made of entities, not collections.

Custom template
^^^^^^^^^^^^^^^

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/troubleshootings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Make sure the `Orphan Removal` option is set to ``true``:

.. code-block:: xml
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="Application\Sonata\MediaBundle\Entity\Gallery" table="media__gallery" >
Expand Down Expand Up @@ -43,7 +43,7 @@ Make sure the ``order-by`` option is correctly set:

.. code-block:: xml
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="Application\Sonata\MediaBundle\Entity\Gallery" table="media__gallery" >
Expand Down

0 comments on commit 4aaa283

Please sign in to comment.