yii 2.0 GridView-自定义按钮和链接,yiigridview-_PHP教程

WBOY
Release: 2016-07-13 10:11:40
Original
960 people have browsed it

yii 2.0 GridView-自定义按钮和链接,yiigridview-

直接贴代码吧:

widget([ 'dataProvider' => $dataProvider, //'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], //显示的字段 //code的值 ['attribute'=>'这是测试code','value'=>function(){return 'abc';}], 'name', 'population', ['class' => 'yii\grid\ActionColumn','header' => '操作',], [ 'label'=>'更多操作', 'format'=>'raw', 'value' => function($data){ $url = "http://www.baidu.com"; return Html::a('添加权限组', $url, ['title' => '审核']); } ] ], ]); ?>
Copy after login

效果如图:

www.bkjia.com true http://www.bkjia.com/PHPjc/927469.html TechArticle yii 2.0 GridView-自定义按钮和链接,yiigridview- 直接贴代码吧: ?= GridView:: widget([ 'dataProvider' = $dataProvider , // 'filterModel' = $searchModel, 'columns' =...
Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!