Skip to content

Commit 4801a55

Browse files
committed
minor #16861 [Translation] Update locale.rst (mohamedGasmii)
This PR was submitted for the 6.0 branch but it was squashed and merged into the 5.4 branch instead. Discussion ---------- [Translation] Update locale.rst Adding php-attributes example. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases 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 `6.x` for features of unreleased versions). --> Commits ------- 2748e2e [Translation] Update locale.rst
2 parents 9ecc3c5 + 2748e2e commit 4801a55

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

translation/locale.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,26 @@ A better policy is to include the locale in the URL using the
8585
{
8686
}
8787
}
88+
89+
.. code-block:: php-attributes
90+
91+
// src/Controller/ContactController.php
92+
namespace App\Controller;
93+
94+
// ...
95+
class ContactController extends AbstractController
96+
{
97+
#[Route(
98+
path: '/{_locale}/contact',
99+
name: 'contact',
100+
requirements: [
101+
'_locale' => 'en|fr|de',
102+
],
103+
)]
104+
public function contact()
105+
{
106+
}
107+
}
88108
89109
.. code-block:: yaml
90110

0 commit comments

Comments
 (0)