Home>
public function rules ()
{
  return array (
    array ("project_id, type_id, status_id, owner_id, requester_id,", "numerical", "integeronly" =>true),    array ("name", "length", "max" =>256),    array ("description", "length", "max" =>2000),    array ("create_time, create_user_id, update_user_id, update_time", "safe"),    array ("id, name, description, project_id, type_id, status_id, owner_id", "on" =>"search"),  );
}
//required:required
array ("title, content", "required"),//match:regular expression validation
array ("birthday", "match", "pattern" =>"%^ \ d {4} (\-| \/| \.) \ d {1,2} \ 1 \ d {1,2} $%"," allowempty "=>true," message "=>" Birthday must be in year-month-day format "),//email:Email format verification
array ("user_mail", "email"),//url:url format verification
array ("user", "url"),//unique:uniqueness verification
array ("username", "unique", "casesensitive" =>false, "classname" =>"user", "message" =>"username" {value} "has been registered,Please replace "),//casesensitive defines whether case sensitivity
//compare:consistency verification
array ("repassword", "compare", "compareattribute" =>"password", "message" =>"The two passwords entered do not match"),//length:length verification
//in:verify that the value of this property is in the list (specified by range).
//numerical:verify that the value of this attribute is a number
//captcha:Verify that the attribute value is the same as shown in the verification code
array ("verifycode", "captcha"),//type:verify that the type of the property is the type specified by type.
//file:verify if a property received a valid upload file
//default:attribute specifies the default value
//exist:verify that the attribute value exists in the database
//boolean:Validate boolean attribute values
//date:check if this attribute describes a date, time or datetime
//safe:The attribute flag is safe for batch assignment.
//unsafe:flag is unsafe,So they cannot be assigned in bulk.
php
  • Previous MySQL Slave triggers oom-killer solution
  • Next js css + html to implement simple calendar