8000 minor #11838 Refactor documentation - Do not add annotation configura… · dmaicher/symfony-docs@e8bb182 · GitHub
[go: up one dir, main page]

Skip to content

Commit e8bb182

Browse files
committed
minor symfony#11838 Refactor documentation - Do not add annotation configuration if you are using Symfony Flex (idetox, elescot)
This PR was merged into the 4.3 branch. Discussion ---------- Refactor documentation - Do not add annotation configuration if you are using Symfony Flex Do not add annotation routing configuration if your project uses Symfony Flex since the recipe already added the annotations.yaml file with the config inside. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 8557b34 Removing space before colon 5190b5e Refactor documentation assuming we use Symfony Flex e1521a0 Update controllers.rst
2 parents c0b3256 + 8557b34 commit e8bb182

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

best_practices/controllers.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,19 @@ this suffix is neither required nor recommended, so you can safely remove it.
4747
Routing Configuration
4848
---------------------
4949

50-
To load routes defined as annotations in your controllers, add the following
51-
configuration to the main routing configuration file:
50+
To load routes defined as annotations in your controllers, run the following command:
51+
52+
.. code-block:: terminal
53+
54+
$ composer require doctrine/annotations
55+
56+
Thanks to the :doc:`Flex recipe</setup/flex>`, a ``config/routes/annotations.yaml`` file will be created:
5257

5358
.. code-block:: yaml
5459
55-
# config/routes.yaml
60+
# config/routes/annotations.yaml
5661
controllers:
57-
resource: '../src/Controller/'
62+
resource: '../../src/Controller/'
5863
type: annotation
5964
6065
This configuration will load annotations from any controller stored inside the

0 commit comments

Comments
 (0)
0