@@ -141,28 +141,26 @@ Using Prefixes
141141
142142You can add routes or other instances of
143143:class: `Symfony\\ Component\\ Routing\\ RouteCollection ` to *another * collection.
144- This way you can build a tree of routes. Additionally you can define a prefix,
145- default requirements, default options and host to all routes of a subtree with
146- the:method: `Symfony\\ Component\\ Routing\\ RouteCollection::addPrefix ` method::
144+ This way you can build a tree of routes. Additionally you can define a prefix
145+ and default values for the parameters, requirements, options, schemes and the
146+ host to all routes of a subtree using methods provided by the
147+ ``RouteCollection `` class::
147148
148149 $rootCollection = new RouteCollection();
149150
150151 $subCollection = new RouteCollection();
151152 $subCollection->add(...);
152153 $subCollection->add(...);
153- $subCollection->addPrefix(
154- '/prefix', // prefix
155- array(), // requirements
156- array(), // options
157- 'admin.example.com', // host
158- array('https') // schemes
159- );
154+ $subCollection->addPrefix('/prefix');
155+ $subCollection->addDefaults(array(...));
156+ $subCollection->addRequirements( array(...));
157+ $subCollection->addOptions( array(...));
158+ $subCollection->setHost( 'admin.example.com');
159+ $subCollection->setMethods( array('POST'));
160+ $subCollection->setSchemes(array('https') );
160161
161162 $rootCollection->addCollection($subCollection);
162163
163- ..versionadded ::2.2
164- The ``addPrefix `` method is added in Symfony2.2. This was part of the
165- ``addCollection `` method in older versions.
166164
167165Set the Request Parameters
168166~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -177,7 +175,9 @@ with this class via its constructor::
177175 $host = 'localhost',
178176 $scheme = 'http',
179177 $httpPort = 80,
180- $httpsPort = 443
178+ $httpsPort = 443,
179+ $path = '/',
180+ $queryString = ''
181181 )
182182
183183.. _components-routing-http-foundation :