Yii2.0框架基础--布局

来源:互联网 发布:java流程图工具 编辑:程序博客网 时间:2024/05/09 02:45

Yii2.0设置网页布局:

1、在控制器中设置(成员变量)

  • pubic $layout = "xxxx";//设置引用布局 
  • pubic $layout = false; //不使用布局

2、在操作中设置

  • $this->layout = "xxxx"; //设置引用布局 
  • $this->layout = false; //不使用布局

3、在视图中设置

  • $this->context->layout = "xxxx"; //设置引用布局 
  • $this->context->layout = false; //不使用布局
0 0
原创粉丝点击