Yii框架学习1-1 应用主体的创建、 设置页面设置布局文件
作者:互联网
一、应用主题
二、Yii中 views目录下的layouts目录一般存放布局文件,如默认的main.php
想更改单个mothod所加载的布局文件, 可以如下:
1、先在layouts下创建文件 如test.php
2、在mothod中更改layout属性
public function actionIndex() { $this->layout = "test"; return $this->render("index"); }
如果不想加载布局文件 ,则设置 layout = false; 如:$this->layout = "test";
标签:文件,layout,框架,布局,Yii,页面设置,layouts,test 来源: https://www.cnblogs.com/gaogaoxingxing/p/12719932.html