: This article mainly introduces thinkphp field Ing. if you are interested in the PHP Tutorial, refer to it. When thinkphp is used, the name in the form must be the same as the name in the database before data can be inserted into the database, to be more secure, sometimes we don't want others to know the field names in the database, so we can use the field ing of thinkphp.
Namespace Home \ Model;
Use Think \ Model;
Class UserModel extends Model {
Proceted $ _ map (){
"Name" => "username"; // map the name in the form to the username in the database
"Mail" => "email"; // map the mail in the form to the email in the database
}
}
// Convert the parseFieldsMap method to print the name and mail
$ User = D ('user ');
$ Data = $ User-> find (3 );
$ Data = $ User-> parseFieldsMap ($ data );
The above introduces thinkphp field ING, including the content, and hope to be helpful to friends who are interested in PHP tutorials.