Learn YII2 framework (III) extension plug-in yii2-gird, yii2yii2-gird from scratch. The YII2 framework (III) extension plug-in yii2-gird, which is an extension of Yii2.0 from scratch. It provides some practical functions based on the official girdview. YII2 framework (III) extensions yii2-gird, yii2yii2-gird from scratch
The yii2-gird plug-in is an extension of Yii2.0. It provides some practical functions based on the official girdview.
For example:
Wrap the table under the bootstrap-panel label to make it more beautiful. the Float Header function makes it easy to view the table fields at the top of the screen when sliding the table. The operation bar label is added; page statistics function; new table reset function; new table export function, including four common formats: html, CSV, txt, Excel.
Thank you very much for the useful plug-ins provided by the Kartik team. Other plug-ins of the Kartik team are also useful. Trial is recommended.
Install yii2-grid
Use Composer for installation. run the following command in windows cmd:
$ composer require kartik-v/yii2-grid "*"
Configure yii2-gird
The yii2-gird is a module and the configuration of the module needs to be added to the configuration file is as follows:
* Note:
\ Kartik \ gird \ Module configure the girdview Module path export/download configure the exported Action path for detailed instructions and Demo
Check the official documentation.
Http://demos.krajee.com/grid-demo
Click "export" to return solution 404
When you click export for the first time, error 404 cannot be found.
Click "export" under analysis. The Complete action path is index. php? = Module/export/download
Because my APP is modularized, there will be a module that calls the downloadAction method of the controller ExportController under the module.
The export Action path configured above is used here. Note that the default configuration of the plug-in is girdview/export/download.
You need to call the downloadAction method of the controller ExportController under the module girdview. if the APP is not multi-module, use the default configuration directly.
Therefore, copy the ExportController method under the plug-in to the module/Controllers/directory.
Click "export" again. a window is displayed, prompting you to save the file.
Extension plug-in yii2-gird, yii2yii2-gird yii2-gird plug-in is an extension of Yii2.0. It expands some practical functions on the basis of the official girdview ....