Skip to content

Commit 32fc740

Browse files
committed
minor #8253 [Routing] Add URI scheme enforcement annotation example (michaelperrin)
This PR was merged into the 2.7 branch. Discussion ---------- [Routing] Add URI scheme enforcement annotation example Commits ------- 35ca18e [Routing] Add URI scheme enforcement annotation example
2 parents 2d6e50a + 35ca18e commit 32fc740

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

routing/scheme.rst

+19
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)