public function buildUrl($name, $parameters = array(), $baseUrl = null)
{
$url = $this->routeByName($name)->interpolate($parameters);
if ($baseUrl) {
return (string) $baseUrl->relative($url);
} else {
if (isset($this->_baseUrl)) {
return $this->_baseUrl->relative($url);
} else {
return $url;
}
}
}
public function testInterpolationFailsWithStarRoutes() { $router = new Routing\Router(); $router->connect('/{fruit}/*', 'fruit'); $this->setExpectedException('Ergo\\Routing\\Exception'); $router->buildUrl('fruit', array('fruit' => 'apple')); }