[FrameworkBundle] fixed TemplateRefence::getPath() when using namespaced controllers (i.e: AcmeBlogBundle\\Controller\\Admin\\PostController)
This commit is contained in:
parent
e145bdf6ff
commit
2616efb03f
@ -41,6 +41,12 @@ class TemplateReference extends BaseTemplateReference
|
||||
public function getPath()
|
||||
{
|
||||
$controller = $this->get('controller');
|
||||
|
||||
// Fix for namespaced controllers
|
||||
if (!empty($controller) && false !== strpos($controller, '\\')) {
|
||||
$controller = str_replace('\\', '/', $controller);
|
||||
}
|
||||
|
||||
$path = (empty($controller) ? '' : $controller.'/').$this->get('name').'.'.$this->get('format').'.'.$this->get('engine');
|
||||
|
||||
return empty($this->parameters['bundle']) ? 'views/'.$path : '@'.$this->get('bundle').'/Resources/views/'.$path;
|
||||
|
Reference in New Issue
Block a user