20150404--rbac+ Plumbing Authority-02

Source: Internet
Author: User

Third, administrator management 1. Add Administrator:

(1) Create a new administrator's controller, add a method, copy the corresponding static template, and modify the path of the style picture.

(2) In the Administrator's model, establish a data validation,

Requirements:

Administrator name cannot be empty

The administrator name must be unique.

The password cannot be empty

Password must be greater than 6 bits less than 12 bits

Two input passwords must be the same

Role cannot be empty

(3) To complete the storage, storage,

One is the role table (It_role), the It_admin_role table

Use a hook function to complete the storage of It_admin_rolei table data, _after_insert ($data, $options)

Add the Inbound code:

2. List of administrators,

Remove the administrator and traverse the data to a static page.

To traverse to a static page:

3, modify the Administrator

(1) Add an Update method to the administrator's controller to remove the records of the modified data

Fetched data traversed to a static page

(2) Modify the It_role table storage

To complete the modification of the validation rule:

(3) Use the hook function to complete the It_admin_role form modification

Add a hook function to the admin model.

Job thinking: Deleting Administrators in bulk,

Idea: Set a form at the outermost of the administrator list.

Five, Model Management

When adding a model, the corresponding additional table is automatically generated and the corresponding field information is created in the attached table.

Tables that need to create models

#模型表 dede_channeltype table ID model name Append table name

CREATE TABLE It_model (

ID tinyint unsigned primary key auto_increment,

ModelName varchar (+) NOT NULL comment ' model name ',

TableName varchar (+) NOT null comment ' Append table name '

) engine MyISAM charset UTF8;

1, add the model,

Add a model to create a corresponding additional table

(1) Create a new controller for the model, add a method for adding, and copy the corresponding static page.

(2) Create a model model and add a method for data validation

(3) Complete the warehousing operation

(4) using the hook function to complete the creation of additional tables,

_after_insert ()

six, column management vii. Content Management

What to add: The field inside the model attached table, to generate the form based on the fields in the table attached to the model

20150404--rbac+ Plumbing Authority-02

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.