本文实例讲述了Yii视图CGridView实现操作按钮定义地址的方法。分享给大家供大家参考,具体如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<?php $this ->widget( 'zii.widgets.grid.CGridView' , array ( 'id' => 'mem-sub-grid' , 'dataProvider' => $model , 'columns' => array ( 'zpc_catname' , array ( 'name' => 'inputtime' , 'value' => 'date("y-m-d H:m",$data->inputtime)' , 'htmlOptions' => array ( 'class' => 't_c' ), ), array ( 'class' => 'CButtonColumn' , //注意URL规则 'updateButtonUrl' => 'Yii::app()->controller->createUrl("updaterole",array("id"=>$data->primaryKey))' , 'deleteConfirmation' => '确认删除' , //删除操作弹框提示的信息 'buttons' => array ( 'view' => array ( 'visible' => 'false' ), //注意URL规则, 'dalete' => array ( 'url' => 'Yii::app()->controller->createUrl("deleterole",array("id"=>$data->primaryKey))' ) ), ), ), )); ?> |
希望本文所述对大家基于Yii框架的PHP程序设计有所帮助。