Skip to content

Commit c4b4ca6

Browse files
committed
Fixed sfPatternRouting and sfRouting
1 parent 5a0adce commit c4b4ca6

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

lib/routing/sfPatternRouting.class.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,38 @@ public function loadConfiguration()
8484
parent::loadConfiguration();
8585
}
8686

87+
/**
88+
* @see sfRouting
89+
*/
90+
public function setDefaultParameter($key, $value)
91+
{
92+
parent::setDefaultParameter($key, $value);
93+
94+
foreach ($this->routes as $route)
95+
{
96+
if (is_object($route))
97+
{
98+
$route->setDefaultParameters($this->defaultParameters);
99+
}
100+
}
101+
}
102+
103+
/**
104+
* @see sfRouting
105+
*/
106+
public function setDefaultParameters($parameters)
107+
{
108+
parent::setDefaultParameters($parameters);
109+
110+
foreach ($this->routes as $route)
111+
{
112+
if (is_object($route))
113+
{
114+
$route->setDefaultParameters($this->defaultParameters);
115+
}
116+
}
117+
}
118+
87119
protected function getConfigFileName()
88120
{
89121
return sfContext::getInstance()->getConfigCache()->checkConfig('config/routing.yml', true);

test/unit/sfNoRouting.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function getRoutes()
7373
/**
7474
* @see sfRouting
7575
*/
76-
public function getRoute()
76+
public function getRoute($name)
7777
{
7878
return null;
7979
}

0 commit comments

Comments
 (0)