Skip to content

Commit

Permalink
minor #4893 Move annotations example to front (ifdattic)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Move annotations example to front

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3
| Fixed tickets |

Commits
-------

aaecb02 Move annotations example to front
  • Loading branch information
weaverryan committed Jan 30, 2015
2 parents 2b7e5ee + aaecb02 commit 7c66a8b
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions cookbook/routing/slash_in_parameter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ a more permissive regex path.

.. configuration-block::

.. code-block:: php-annotations
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class DemoController
{
/**
* @Route("/hello/{name}", name="_hello", requirements={"name"=".+"})
*/
public function helloAction($name)
{
// ...
}
}
.. code-block:: yaml
_hello:
Expand Down Expand Up @@ -60,19 +75,4 @@ a more permissive regex path.
return $collection;
.. code-block:: php-annotations
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class DemoController
{
/**
* @Route("/hello/{name}", name="_hello", requirements={"name" = ".+"})
*/
public function helloAction($name)
{
// ...
}
}
That's it! Now, the ``{username}`` parameter can contain the ``/`` character.

0 comments on commit 7c66a8b

Please sign in to comment.