Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Routing] Document the PSR-4 route loader#17373
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -37,15 +37,22 @@ Otherwise, create the following file manually: | ||
| # config/routes/attributes.yaml | ||
| controllers: | ||
| resource: ../../src/Controller/ | ||
| type: attribute@App\Controller | ||
| kernel: | ||
| resource:App\Kernel | ||
| type: attribute | ||
| This configuration tells Symfony to look for routes defined as attributes on | ||
| classes declared in the ``App\Controller`` namespace which are stored in the | ||
| ``src/Controller/`` directory which follows the PSR-4 standard. In addition, | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. missing colon MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Not sure, it feels very German to set that comma. Let's see what the docs team says. | ||
| our kernel can act as a controller as well which is especially useful for small | ||
Contributor
| ||
| applications that use Symfony as a microframework. | ||
| .. versionadded:: 6.2 | ||
| The possibility to suffix the ``attribute`` resource type with a PSR-4 | ||
| namespace root was introduced in Symfony 6.2. | ||
| Suppose you want to define a route for the ``/blog`` URL in your application. To | ||
| do so, create a :doc:`controller class </controller>` like the following: | ||