From 35ca18e51a429a9664425e5d619a5fe588edfcf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michae=CC=88l=20Perrin?= Date: Wed, 2 Aug 2017 12:37:47 +0200 Subject: [PATCH] [Routing] Add URI scheme enforcement annotation example --- routing/scheme.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/routing/scheme.rst b/routing/scheme.rst index b7a41299c94..2f92232ee48 100644 --- a/routing/scheme.rst +++ b/routing/scheme.rst @@ -10,6 +10,25 @@ the URI scheme via schemes: .. configuration-block:: + .. code-block:: php-annotations + + // src/AppBundle/Controller/MainController.php + namespace AppBundle\Controller; + + use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; + + class MainController extends Controller + { + /** + * @Route("/secure", name="secure", schemes={"https"}) + */ + public function secureAction() + { + // ... + } + } + .. code-block:: yaml # app/config/routing.yml