Home  >  Article  >  php教程  >  Yii view CGridView implements operation button definition address example

Yii view CGridView implements operation button definition address example

高洛峰
高洛峰Original
2016-12-30 16:12:431287browse

The example of this article describes the method of defining the address of the operation button in the Yii view CGridView. Share it with everyone for your reference, the details are as follows:

<?php $this->widget(&#39;zii.widgets.grid.CGridView&#39;, array(
  &#39;id&#39;=>&#39;mem-sub-grid&#39;,
  &#39;dataProvider&#39;=>$model,
  &#39;columns&#39;=>array(
    &#39;zpc_catname&#39;,
    array(&#39;name&#39;=>&#39;inputtime&#39;,
        &#39;value&#39;=>&#39;date("y-m-d H:m",$data->inputtime)&#39;,
        &#39;htmlOptions&#39;=>array(&#39;class&#39;=>&#39;t_c&#39;),
        ),
    array(
      &#39;class&#39;=>&#39;CButtonColumn&#39;,
      //注意URL规则
      &#39;updateButtonUrl&#39;=>&#39;Yii::app()->controller->createUrl("updaterole",array("id"=>$data->primaryKey))&#39;,
      &#39;deleteConfirmation&#39;=>&#39;确认删除&#39;,//删除操作弹框提示的信息
      &#39;buttons&#39;=>array(
        &#39;view&#39;=>array(&#39;visible&#39;=>&#39;false&#39;),
        //注意URL规则,
        &#39;dalete&#39;=>array(&#39;url&#39;=>&#39;Yii::app()->controller->createUrl("deleterole",array("id"=>$data->primaryKey))&#39;)
      ),
    ),
  ),
));
?>

I hope this article will be helpful to everyone’s PHP program design based on the Yii framework.

For more Yii view CGridView implementation operation button definition address examples and related articles, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn