想法如下: 有时候我觉得用views中的参数来决定用哪个layout 这样子该怎么做呢?
frontend/views/page/xxx.php$this->layout='main'; 报错
$this->layout='main';
<?php include("../layouts/main.php"); ?>报错
<?php include("../layouts/main.php"); ?>
该怎么做呢?
由view倒置决定使用哪个layout怎么做到?
解决方法:
$this->context->layout='page';
走同样的路,发现不同的人生
$this->content->layout = '@app/views/layouts/other.php';
走同样的路,发现不同的人生