Yii2.0 GridView custom button and link usage, yii2.0gridview
The example in this article describes the usage of GridView custom buttons and links in yii2.0. Share it with everyone for your reference. The specific implementation method is as follows:
Copy code The code is as follows:
= GridView::widget([
'dataProvider' => $dataProvider,
//'filterModel' => $searchModel,
'columns' => [
['class' => 'yiigridSerialColumn'],
//Displayed fields
//code value
['attribute'=>'This is the test code','value'=>function(){return 'abc';}],
'name',
'population',
['class' => 'yiigridActionColumn','header' => 'Action',],
[
'label'=>'More operations',
'format'=>'raw',
'value' => function($data){
$url = "http://www.baidu.com";
return Html::a('Add permission group', $url, ['title' => 'Audit']);
}
],
]); ?>
The running effect is shown in the figure below:
I hope this article will be helpful to everyone’s PHP program design based on the Yii framework.
http://www.bkjia.com/PHPjc/928226.html
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/928226.htmlTechArticleGridView custom buttons and link usage in yii2.0, yii2.0gridview This article describes the GridView in yii2.0 with examples Custom button and link usage. Share it with everyone for your reference. Specific implementation method...