third, the front desk member registration and login
View the design of members and administrator tables in Ecshop
Create a Membership table:
CREATE TABLE It_user (
ID smallint unsigned primary key auto_increment,
Username varchar (+) NOT NULL comment ' member's username ',
Password char (+) NOT NULL comment ' member's password ',
Email varchar (+) NOT NULL comment ' member's mailbox '
) engine MyISAM charset UTF8; 1, complete the registration function:
(1) Create a new user controller under the home module and inherit the index controller. and add the Register method, and copy the corresponding template page, modify the form according to the table structure.
(2) Create a new user model and add data validation,
(3) Complete the registration and login connection in the Header.html template page
2, complete the user's login
Create a new login method under the user controller and copy the corresponding template page.
Modify a signed-in form
The login function defined in the user model,
In the user controller, code:
In the header.html template page, depending on whether the login displays data,
3, save the user's information into the cookie, the next visit is directly logged in.
Iv. Complete the Product Details page
1. Add a goods method to the index controller to remove the product details. and copy the corresponding template page
Color is the name of the property: White is the value of the property
The name of the property in the It_attribute table, the value of the property in the It_goods_attr table
property sheet for the commodity:
It_goods_attr
attribute table for commodity types:
It_attribute;
Select A.attr_id,b.attr_type,b.attr_name,a.attr_value from It_goods_attr a left joins It_attribute B on A.attr_id=b.id whe Re a.goods_id=
2. The code in the goods method:
3, in the template page to traverse:
Five, complete a breadcrumb navigation
Idea: Find a family tree based on the cat_id of the product.
Open the category model and add a method to find the family tree
In the index controller below the home module, the index and category and the goods method call the function.
Traverse in the template page:
20150415--Front End Login + Product Details-02