码迷,mamicode.com
首页 > 其他好文 > 详细

yii控制布局方式

时间:2017-09-06 11:43:24      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:this   设置   控制   视图view   成员方法   main   文件   布局   public   

1:在控制器内成员变量设置
public $layout = false; //不使用布局
public $layout = “main”; //设置使用的布局文件

2:在控制器成员方法内设置
$this->layout = false; //不使用布局
$this->layout = “main”; //设置使用的布局文件

3:在视图views中选择布局设置
$this->context->layout = false; //不使用布局
$this->context->layout = ‘main’; //设置使用的布局文件

yii控制布局方式

标签:this   设置   控制   视图view   成员方法   main   文件   布局   public   

原文地址:http://www.cnblogs.com/JahanGu/p/7483608.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!