[Routing] fixed Route annotation for hostname (should be hostname_pattern instead of hostnamePattern)
This commit is contained in:
parent
62de881ddb
commit
d91e5a26a2
@ -44,7 +44,7 @@ class Route
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($data as $key => $value) {
|
foreach ($data as $key => $value) {
|
||||||
$method = 'set'.$key;
|
$method = 'set'.str_replace('_', '', $key);
|
||||||
if (!method_exists($this, $method)) {
|
if (!method_exists($this, $method)) {
|
||||||
throw new \BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $key, get_class($this)));
|
throw new \BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $key, get_class($this)));
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,8 @@ class RouteTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('requirements', array('_method' => 'GET'), 'getRequirements'),
|
array('requirements', array('_method' => 'GET'), 'getRequirements'),
|
||||||
array('options', array('compiler_class' => 'RouteCompiler'), 'getOptions'),
|
array('options', array('compiler_class' => 'RouteCompiler'), 'getOptions'),
|
||||||
array('name', 'blog_index', 'getName'),
|
array('name', 'blog_index', 'getName'),
|
||||||
array('defaults', array('_controller' => 'MyBlogBundle:Blog:index'), 'getDefaults')
|
array('defaults', array('_controller' => 'MyBlogBundle:Blog:index'), 'getDefaults'),
|
||||||
|
array('hostname_pattern', array('{locale}.example.com'), 'getHostnamePattern')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user