Skip to content

Commit aaecb02

Browse files
committed
Move annotations example to front
| Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets |
1 parent bcf1508 commit aaecb02

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

cookbook/routing/slash_in_parameter.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@ a more permissive regex path.
2424

2525
.. configuration-block::
2626

27+
.. code-block:: php-annotations
28+
29+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
30+
31+
class DemoController
32+
{
33+
/**
34+
* @Route("/hello/{name}", name="_hello", requirements={"name"=".+"})
35+
*/
36+
public function helloAction($name)
37+
{
38+
// ...
39+
}
40+
}
41+
2742
.. code-block:: yaml
2843
2944
_hello:
@@ -60,19 +75,4 @@ a more permissive regex path.
6075
6176
return $collection;
6277
63-
.. code-block:: php-annotations
64-
65-
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
66-
67-
class DemoController
68-
{
69-
/**
70-
* @Route("/hello/{name}", name="_hello", requirements={"name" = ".+"})
71-
*/
72-
public function helloAction($name)
73-
{
74-
// ...
75-
}
76-
}
77-
7878
That's it! Now, the ``{username}`` parameter can contain the ``/`` character.

0 commit comments

Comments
 (0)