Learn from scratch YII2 Framework (iii) Extension yii2-gird,yii2yii2-gird_php tutorial

Source: Internet
Author: User

Learn YII2 Framework (iii) extension from scratch Yii2-gird,yii2yii2-gird


The Yii2-gird plugin is an extension of the Yii2.0. It has expanded some useful functions on the basis of official Girdview.

Like what:

The table is wrapped in the Bootstrap-panel label to make it more beautiful; Float header function, when implementing sliding table, the table field for the top of the screen, convenient to view, add the Action Bar Description label, page statistics function, new Reset table function, add the export table function, Includes four common formats [HTML, CSV, TXT, Excel].

Thank you very much for the easy-to-use Kartik team. The other plugins of the Kartik team are also very useful. Recommended trial.

Installing Yii2-grid

Using the composer installation, Windows cmd executes the command:

$ composer require Kartik-v/yii2-grid "*"

Configure Yii2-gird

Yii2-gird is a module that needs to be configured to include modules in the configuration file as follows:


Description

\kartik\gird\module Configuring the path of the Girdview module Export/download Configuring the exported action path detailed description and demo

Look directly at the official documents.

Http://demos.krajee.com/grid-demo

Click "Export" to return to 404 of the workaround

The first time you click "Export" Error 404 Can not find the interface.

Under Analysis, click "Export" when the action completion path is Index.php?=module/export/download

Because my app is modular, it comes with a module that calls the Downloadaction method of the controller Exportcontroller

Here is the use of the above configuration of the export action path, it should be noted that: plug-in default configuration is Girdview/export/download

The Downloadaction method that needs to be called is the controller Exportcontroller under module Girdview, if the app is not multi-module, use the default configuration directly.

So here we need to copy the Exportcontroller method under the plugin to the module/controllers/directory

Click "Export" again to save the file with a successful popup window.




http://www.bkjia.com/PHPjc/866659.html www.bkjia.com true http://www.bkjia.com/PHPjc/866659.html techarticle Learn from scratch YII2 Framework (c) Extension Yii2-gird,yii2yii2-gird Yii2-gird plug-in is an extension of Yii2.0. It has expanded some useful functions on the basis of official Girdview. ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.