PHP.28-TP Framework Mall Application Example-backstage 4-use the GII to generate the code for brand tables

Source: Internet
Author: User

GII Installation "GII for Marketplace projects"

Copy the GII folder to application Yes, Access http://xx.com/index.php/gii

GII rule "GII rules of use are closely related to the rules of the building of tables"

1, the Building table field must have the Chinese name , the GII generates the code to recognize the Chinese name of a field;

2. A field validation rule cannot be empty: Set the Construction table field is not NULL, all fields are not NULL, and if you do not want to generate a validation rule , add the default value, default (which can be empty);

3. Generate Upload Image code : The field name must contain Logo|image|pic|face string

Example of Brand management

1. structuring the brand data sheet

CREATE TABLE P39_brand (    null auto_increment comment ' Id ',    brand_name varchar (  Null comment ' brand name ',    site_url varchar (nulldefault ' comment ' official URL ',     Logo varchar (nulldefault ' comment ' brand logo image ',    key  (ID ) enginedefault charset=utf8 comment ' brand ';

2. generate configuration files based on table name

3, Modify the configuration file "Note: The name of the table, code generation to the module"

4. Model configuration

5 . Configure how the fields in the form display "pictures, text boxes, online editors, radio boxes, etc."

6 . Configure the search on the list page

7, according to the configuration file p39_brand.php build controller brandcontroller.class.php| model brandmodel.class.php| view view{add.html/lst.html/ edit.html} Code "if the code already exists, it will be overwritten directly"

Note: Some places also need fine-tuning, specific test can be

PHP.28-TP Framework Marketplace Application Example-background 4-use the GII to generate the code for a branded table

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.