Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reword paragraph #1083

Merged
merged 4 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/components/guidesXml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Register the new configuration option in the :php:`TreeBuilder` at

Using the tree builder is a topic of itself. Refer to the according symfony documentation.

If the configuration is a setting option to controll the applications workflow you can
If the configuration is a setting option to control the applications workflow you can
save it in the :php:class:`phpDocumentor\Guides\Settings\ProjectSettings`. Examples of
settings options would be `logPath`, `showProgressBar` or `theme`.

Expand Down
16 changes: 8 additions & 8 deletions docs/developers/extensions/structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ Each Composer package must have a file `composer.json`. See an example here:
:lineos:

The PHP sources can be found in the directory `src` then as is stated in line 8
in the `composer.json`.
in the `composer.json`.

.. _extension_symfony:

Create an extension
===================

For the PHP package to be an extension you need a class
extending `\Symfony\Component\DependencyInjection\Extension\Extension` by
implementing the interface
`Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface` we
can also add our own configurations to our extension:
extending `\Symfony\Component\DependencyInjection\Extension\Extension`.
By implementing the interface
`Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface`
you can also configure the guides extension from your extension:

.. literalinclude:: _YourExtension.php
:language: php
:caption: your-extension/DependencyInjection/YourExtension.php
:caption: your-extension/src/DependencyInjection/YourExtension.php
:lineos:

Lines 24 to 28 load a :ref:`Dependency Injection configuration <extension_di_configuration>`
file. Lines 29 to 36 configure the directory overriding the default templates.
Lines 24 to 28 load a :ref:`Dependency Injection configuration <extension_di_configuration>`
file. Lines 29 to 36 configure the directory overriding the default templates.
Read chapter :ref:`extending_templates` to learn more about this.

.. note::
Expand Down
8 changes: 4 additions & 4 deletions docs/developers/extensions/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Register the templates overrides in your extension's

.. literalinclude:: _YourExtension.php
:language: php
:caption: your-extension/DependencyInjection/YourExtension.php
:caption: your-extension/src/DependencyInjection/YourExtension.php
:lineos:
:emphasize-lines: 29-35

It is recommended to always extend an existing template so that the Twig files
of the base templates can be used as fallback for non-defined specific template
files.

In order to extend the default bootstrap theme, require the according base
In order to extend the default bootstrap theme, require the according base
extension in your extension's `composer.json`:

.. code-block:: json
Expand All @@ -35,12 +35,12 @@ extension in your extension's `composer.json`:

And then set `'extends' => 'bootstrap'` (line 32 in the first code-snippet).

To extend the base template (plain HTML) require `phpdocumentor/guides` in your
To extend the base template (plain HTML) require `phpdocumentor/guides` in your
`composer.json`, and omit the key `extends`:


.. code-block:: php
:caption: your-extension/DependencyInjection/YourExtension.php
:caption: your-extension/src/DependencyInjection/YourExtension.php

$container->prependExtensionConfig('guides', [
'themes' => ['mytheme' => dirname(__DIR__, 3) . '/resources/template'],
Expand Down
Loading