Skip to content

Commit

Permalink
Document available DI tags
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Sep 22, 2017
1 parent 5cd083a commit fd1f3fe
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
45 changes: 45 additions & 0 deletions reference/di_tags.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Symfony dependency injection tags
=================================

The following lists all dependency injection tags and their usage available
in Netgen Content Browser:

``netgen_content_browser.backend``
----------------------------------

**Purpose**: Adds a new backend to the system

A backend is a service that provides methods to load the list of items and
locations in Content Browser interface. A backend needs to implement
``Netgen\ContentBrowser\Backend\BackendInterface`` interface.

When registering a new backend, you need to use the ``item_type`` attribute in
the tag to specify the item type the backend is used for:

.. code-block:: yaml
app.content_browser.my_backend:
class: AppBundle\ContentBrowser\MyBackend
tags:
- { name: netgen_content_browser.backend, item_type: my_backend }
``netgen_content_browser.column_value_provider``
------------------------------------------------

**Purpose**: Adds a new column value provider for a single item column

A column value provider is a service that provides a value to a column displayed
in Content Browser interface for a specific item. Column value provider needs to
implement
``Netgen\ContentBrowser\Item\ColumnProvider\ColumnValueProviderInterface``
interface.

When registering a new column value provider, you need to use the ``identifier``
attribute in the tag to attach a unique identifier to the provider:

.. code-block:: yaml
app.content_browser.my_item.custom_column:
class: AppBundle\ContentBrowser\MyItem\CustomColumn
tags:
- { name: netgen_content_browser.column_value_provider, identifier: my_item\custom_column }
1 change: 1 addition & 0 deletions reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ Reference
install_instructions
configuration
symfony_services
di_tags

.. include:: /reference/map.rst.inc
1 change: 1 addition & 0 deletions reference/map.rst.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* :doc:`/reference/install_instructions`
* :doc:`/reference/configuration`
* :doc:`/reference/symfony_services`
* :doc:`/reference/di_tags`

0 comments on commit fd1f3fe

Please sign in to comment.