mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fixes #1965: Controller::findLayoutFile()
returns incorrect file path when layout name starts with a slash
This commit is contained in:
@ -400,7 +400,7 @@ class Controller extends Component implements ViewContextInterface
|
||||
if (strncmp($layout, '@', 1) === 0) {
|
||||
$file = Yii::getAlias($layout);
|
||||
} elseif (strncmp($layout, '/', 1) === 0) {
|
||||
$file = Yii::$app->getLayoutPath() . DIRECTORY_SEPARATOR . $layout;
|
||||
$file = Yii::$app->getLayoutPath() . DIRECTORY_SEPARATOR . substr($layout, 1);
|
||||
} else {
|
||||
$file = $module->getLayoutPath() . DIRECTORY_SEPARATOR . $layout;
|
||||
}
|
||||
|
Reference in New Issue
Block a user