File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -142,23 +142,29 @@ Using Prefixes
142142You can add routes or other instances of
143143:class: `Symfony\\ Component\\ Routing\\ RouteCollection ` to *another * collection.
144144This way you can build a tree of routes. Additionally you can define a prefix,
145- default requirements, default options and hostname to all routes of a subtree::
145+ default requirements, default options and hostname to all routes of a subtree
146+ with the :method: `Symfony\\ Component\\ Routing\\ RouteCollection::addPrefix `
147+ method::
146148
147149 $rootCollection = new RouteCollection();
148150
149151 $subCollection = new RouteCollection();
150152 $subCollection->add(...);
151153 $subCollection->add(...);
152-
153- $rootCollection->addCollection(
154- $subCollection,
154+ $subCollection->addPrefix(
155155 '/prefix', // prefix
156156 array(), // requirements
157157 array(), // options
158158 'admin.example.com', // hostname
159159 array('https') // schemes
160160 );
161161
162+ $rootCollection->addCollection($subCollection);
163+
164+ .. versionadded :: 2.2
165+ The ``addPrefixs `` method is added in Symfony2.2. This was part of the
166+ ``addCollection `` method in older versions.
167+
162168Set the Request Parameters
163169~~~~~~~~~~~~~~~~~~~~~~~~~~
164170
You can’t perform that action at this time.
0 commit comments