Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2834e7e

Browse filesBrowse files
committed
added scheme and method setter in RouteCollection
1 parent 10183de commit 2834e7e
Copy full SHA for 2834e7e

File tree

Expand file treeCollapse file tree

1 file changed

+24
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+24
-0
lines changed

‎src/Symfony/Component/Routing/RouteCollection.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/RouteCollection.php
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,30 @@ public function addOptions(array $options)
318318
}
319319
}
320320

321+
/**
322+
* Sets the schemes (e.g. 'https') all child routes are restricted to.
323+
*
324+
* @param string|array $schemes The scheme or an array of schemes
325+
*/
326+
public function setSchemes($schemes)
327+
{
328+
foreach ($this->routes as $route) {
329+
$route->setSchemes($schemes);
330+
}
331+
}
332+
333+
/**
334+
* Sets the HTTP methods (e.g. 'POST') all child routes are restricted to.
335+
*
336+
* @param string|array $methods The method or an array of methods
337+
*/
338+
public function setMethods($methods)
339+
{
340+
foreach ($this->routes as $route) {
341+
$route->setMethods($methods);
342+
}
343+
}
344+
321345
/**
322346
* Returns an array of resources loaded to build this collection.
323347
*

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.