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