@@ -682,63 +682,6 @@ form via the same URL, while using distinct controllers for the two actions.
682682Like the other requirements, the ``_method `` requirement is parsed as a regular
683683expression. To match ``GET `` *or * ``POST `` requests, you can use ``GET|POST ``.
684684
685- .. index ::
686- single: Routing; Scheme requirement
687-
688- Adding HTTP Scheme Requirements
689- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
690-
691- You can also match on the HTTP *scheme * of the incoming request (i.e. HTTP or
692- HTTPS). This can be used to force certain routes to be matched and generated
693- with the given scheme. This can be accomplished with the following route
694- configuration:
695-
696- .. configuration-block ::
697-
698- .. code-block :: yaml
699-
700- secure :
701- pattern : /secure
702- defaults : { _controller: AcmeDemoBundle:Main:secure }
703- requirements :
704- _scheme : https
705-
706- .. code-block :: xml
707-
708- <?xml version =" 1.0" encoding =" UTF-8" ?>
709-
710- <routes xmlns =" http://symfony.com/schema/routing"
711- xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
712- xsi : schemaLocation =" http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd" >
713-
714- <route id =" secure" pattern =" /secure" >
715- <default key =" _controller" >AcmeDemoBundle:Main:secure</default >
716- <requirement key =" _scheme" >https</requirement >
717- </route >
718- </routes >
719-
720- .. code-block :: php
721-
722- use Symfony\Component\Routing\RouteCollection;
723- use Symfony\Component\Routing\Route;
724-
725- $collection = new RouteCollection();
726- $collection->add('secure', new Route('/secure', array(
727- '_controller' => 'AcmeDemoBundle:Main:secure',
728- ), array(
729- '_scheme' => 'https',
730- )));
731-
732- return $collection;
733-
734- The above configuration forces the ``secure `` route to use HTTPS. When
735- generating the ``secure `` URL, and if the current scheme is HTTP, Symfony will
736- automatically generate an absolute URL with HTTPS as the scheme.
737-
738- The requirement is also enforced for incoming requests. If you try to access
739- the ``/secure `` path with HTTP, you will be automatically redirected to the
740- same URL but with the HTTPS scheme.
741-
742685.. index ::
743686 single: Routing; Advanced example
744687 single: Routing; _format parameter
@@ -1190,4 +1133,9 @@ Routing is a system for mapping the URL of incoming requests to the controller
11901133function that should be called to process the request. It both allows you
11911134to specify beautiful URLs and keeps the functionality of your application
11921135decoupled from those URLs. Routing is a two-way mechanism, meaning that it
1193- should also be used to generate URLs.
1136+ should also be used to generate URLs.
1137+
1138+ Learn more from the Cookbook
1139+ ----------------------------
1140+
1141+ * :doc: `/cookbook/routing/schema `
0 commit comments