Yii2.0 's GridView Custom button and link usage, Yii2.0gridview
This example describes the yii2.0 GridView custom button and link usage. Share to everyone for your reference. The implementation method is as follows:
Copy the Code code as follows:
<?= Gridview::widget ([
' Dataprovider ' = $dataProvider,
' Filtermodel ' = $searchModel,
' Columns ' = [
[' class ' = ' Yii\grid\serialcolumn '],
The fields displayed
The value of code
[' attribute ' = ' This is test code ', ' Value ' =>function () {return ' abc ';}],
' Name ',
' Population ',
[' class ' = ' Yii\grid\actioncolumn ', ' header ' = ' operation ',],
[
' Label ' = ' More action ',
' Format ' = ' raw ',
' Value ' = function ($data) {
$url = "http://www.baidu.com";
Return html::a (' Add Permission Group ', $url, [' title ' = ' audit ']);
}
]
],
]);?>
The effect is as follows:
It is hoped that this article is helpful to the PHP program design based on YII framework.
http://www.bkjia.com/PHPjc/928226.html www.bkjia.com true http://www.bkjia.com/PHPjc/928226.html techarticle yii2.0 's GridView Custom button and link usage, Yii2.0gridview This article describes the yii2.0 GridView custom button and link usage. Share to everyone for your reference. Concrete implementation of the party ...