Use the custom button and link in the GridView of yii2.0, yii2.0gridview. Yii2.0 uses the custom buttons and links in the GridView. the examples in this article describe the usage of the custom buttons and links in the GridView of yii2.0. Share it with you for your reference. The specific implementation method is yii2.0's GridView custom button and link usage, yii2.0gridview
This article describes the usage of the custom buttons and links in the GridView of yii2.0. Share it with you for your reference. The specific implementation method is as follows:
The code is as follows:
<? = GridView: widget ([
'Dataprovider' => $ dataProvider,
// 'Filtermodel' => $ searchModel,
'Columns '=> [
['Class' => 'yii \ grid \ SerialColumn '],
// Fields displayed
// Code value
['Attribute' => 'this is the test code', 'value' => function () {return 'abc';}],
'Name ',
'Population ',
['Class' => 'yii \ grid \ actioncolumn', 'header' => 'operation',],
[
'Label' => 'More operations ',
'Format' => 'raw ',
'Value' => function ($ data ){
$ Url = "http://www.baidu.com ";
Return Html: a ('add permission group', $ url, ['title' => 'review']);
}
]
],
]);?>
Shows the running effect:
I hope this article will help you design PHP programs based on the Yii Framework.
Examples in this article describes how to use the custom buttons and links of the GridView in yii2.0. Share it with you for your reference. Implementation...