mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-19 07:07:58 +08:00
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:
committed by
SilverFire - Dmitry Naumenko
parent
7da8ca8a67
commit
d08ef83e2a
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user