ohding
有几个变量是CListView内部声明的:
$this: refers to the owner of this list view widget. For example, if the widget is in the view of a controller, then $this refers to the controller.
$data: refers to the data item currently being rendered.
$index: refers to the zero-based index of the data item currently being rendered.
$widget: refers to this list view widget instance.- ohding 回复了话题 CGridView 怎么给一行加超链接
filter就是表格标题下面提供快速搜索功能的那行,可以做成下拉框,文本框等等
- ohding 回复了话题 role角色验证的问题,求解?
简单应用真不建议用rbac了按照action控制权限已经够了,
这些代码只要运行一次就可以,写哪都行,如果你熟悉结构自己加到数据库也行 - ohding 回复了话题 计数器updateCounters问题
把controller贴出来看下哈
- ohding 回复了话题 关于 active record 的问题
$result = User::model()->findAll('username=:username or email=:email',array(':username'=>'lisi',':email'=>'22@qq.com'));
结果如果不是唯一的话记得要遍历
- ohding 回复了话题 renderPartial问题请教
楼上正解
- ohding 回复了话题 怎么YII官网进不去了啊
GFW又升级呗。。。感谢楼上的代理
就跟这个论坛发完贴出来的+5提示一样的消息框,显示几秒钟然后会消失,用jquery很容易实现这种效果
- ohding 回复了话题 父类是一个id号,怎样在视图中把它转成名字
搞的太复杂了,如果你只是找一层的父元素,可以这样写:
public function relations() { return array( 'parent'=>array(self::BELONGS_TO,'xy_bumen','p_bumen'), ); }
==============VIEW==============
<?php $this->widget('zii.widgets.grid.CGridView', array( 'id'=>'bumen-grid', 'dataProvider'=>$model->search(), 'filter'=>$model, 'columns'=>array( 'bumen', 'parent.bumen', )); ?>
setflash是创建一个渐隐形式的消息框,所谓的储存只是在当前session里面储存,
不会重复上次的,重新调用runDialog就会重新构建