Learn from scratch YII2 Framework (iv) Extension yii2-kartikgii,yii2yii2-kartikgii_php tutorial

Source: Internet
Author: User

Learn YII2 Framework (iv) extension from scratch Yii2-kartikgii,yii2yii2-kartikgii


Today found a useful plugin yii2-kartikgii. It is based on a series of plug-in kartik-v expansion.

Plugin Introduction

The main function of this plugin is to help you generate Kartik-gird when using the GII to generate code curd. There is no need to manually add Kartik-gird every time you generate code with the default GII tool, which is exactly what I want. Quickly generate Kartik-grid.

Before you learn this plugin you may need to know the following Yii2-gird plugin: Portal

Plug-in installation and configuration

Look directly at the plugin URL:

http://www.yiiframework.com/extension/yii2-kartikgii/

Plugin trial

There is just one project that uses this plugin and tries out the code generated by the plugin.


The resulting page of the visit is as follows:

It is worth mentioning that kartikgii the Yii2-gird basically completely compatible with the down.

This includes a very functional "floating Header", a feature that, when you browse multiple data, the field name of the table can always be displayed above the browser.

is similar to the fixed header in Excel.

Bugs and Fixes

In the process of using the plug-in, generate complete code, access to Crud index.php, will be error.

After catching the code and discovering a small bug, the author wants to comment out a piece of code in the Crud method template that comes with the framework. However, the annotation symbol used is "//",

The generated code only commented on one line, and several other lines were not commented out, so an error was made. I manually modified the Generate code template.

Found a bug, the first time to notify the plugin author, fixed the bug. Can now be used normally.

Custom templates

In fact, after installing the plugin, you can modify these files in the plugin file


By modifying these template files, you can customize the generated code. Pre-backup is recommended.




http://www.bkjia.com/PHPjc/866657.html www.bkjia.com true http://www.bkjia.com/PHPjc/866657.html techarticle Learn from scratch YII2 Framework (iv) Extension yii2-kartikgii,yii2yii2-kartikgii today found a good plug-in yii2-kartikgii. It is based on a series of plug-in kartik-v expansion. Plug ...

  • 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.