Skip to content

Commit 4b9d981

Browse files
committed
[Routing] Add URI scheme enforcement annotation example
1 parent 861e72b commit 4b9d981

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

routing/scheme.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@ the URI scheme via schemes:
1010

1111
.. configuration-block::
1212

13+
.. code-block:: php-annotations
14+
15+
// src/AppBundle/Controller/MainController.php
16+
namespace AppBundle\Controller;
17+
18+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
19+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
20+
21+
class MainController extends Controller
22+
{
23+
/**
24+
* @Route("/secure", name="secure", schemes={"HTTPS"})
25+
*/
26+
public function secureAction()
27+
{
28+
// ...
29+
}
30+
}
31+
1332
.. code-block:: yaml
1433
1534
# app/config/routing.yml

0 commit comments

Comments
 (0)