Controller->viewPath can be set, fixes #10086

Added setViewPath() that allows setting the base path for the
controller's views. Changed getViewPath() to return the value that was
explicitly set, before defaulting to the usual module-based path.
This commit is contained in:
Luis Hernández
2015-11-21 19:28:06 +02:00
committed by SilverFire - Dmitry Naumenko
parent 7da8ca8a67
commit d08ef83e2a
3 changed files with 24 additions and 7 deletions

View File

@@ -243,11 +243,10 @@ class Module extends ServiceLocator
*/
public function getViewPath()
{
if ($this->_viewPath !== null) {
return $this->_viewPath;
} else {
return $this->_viewPath = $this->getBasePath() . DIRECTORY_SEPARATOR . 'views';
if ($this->_viewPath === null) {
$this->_viewPath = $this->getBasePath() . DIRECTORY_SEPARATOR . 'views';
}
return $this->_viewPath;
}
/**