Skip to content

Commit a267be3

Browse files
committed
Document how to create an extension
1 parent 898c14e commit a267be3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/extension/index.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@
44
Extending the phpdocumentor/guides
55
==================================
66

7+
``phpdocumentor/guides`` relies on `Symfony Dependency Injection
8+
Container
9+
<https://symfony.com/doc/current/components/dependency_injection.html#setting-up-the-container-with-configuration-files>`__
10+
extensions. This means that to extend the guides, you need to define
11+
such an extension, after what it becomes possible to make the guides CLI
12+
aware of it by creating a ``guides.xml`` file in the directory from
13+
which you invoke the CLI.
14+
15+
It should look like this::
16+
17+
.. code-block:: xml
18+
19+
<?xml version="1.0" encoding="UTF-8" ?>
20+
<guides>
21+
<extension class="YourName\YourExtension\DependencyInjection\YourExtension"/>
22+
</guides>
23+
24+
Internally, the guides CLI defines and uses default extensions.
25+
Once you have that set up, you can create PHP classes, define services
26+
from it, and tag them so that they are recognized and usable by the
27+
guides CLI.
28+
729
Some ways to extend the guides:
830

931
.. toctree::

0 commit comments

Comments
 (0)