Public Function rules () {return array (//must be filled in with an array (' email, username, Password,agree,verifypassword,verif Ycode ', ' required '),//Check whether the user name repeats array (' email ', ' unique ', ' message ' = ' user name is occupied '),//user input maximum character limit Array (' email, username ', ' length ', ' Max ' =>64),//Limit the user minimum length and maximum length of the array (' username ', ' length ', ' Max ' =>7, ' min ' =>2, ' toolong ' + ' username Please enter a length of 4-14 characters ', ' tooshort ' + ' username Please enter a length of 2-7 words '),//Limit password minimum length and maximum length array (' Pass Word ', ' length ', ' Max ' =>22, ' min ' =>6, ' toolong ' + ' password Please enter a length of 6-22 characters ', ' tooshort ' and ' = ' password Please enter a length of 6-22 characters '),// Whether the user input is the Mail array (' email ', ' email ', ' message ' = ' mailbox format error '),//Check whether the user entered the password is the same as the array (' VerifyPassword ', ' Compare ', ' compareattribute ' = ' password ', ' message ' + ' Please enter the confirmation password ',//check whether the user agrees to the terms of the agreement array (' agree ', ' requ Ired ', ' Requiredvalue ' =>true, ' message ' + ' Please confirm whether you agree to the terms of the Privacy Agreement '),//Determine if the date format is array (' created ', ' Date ', ' forma T ' = ' yyyy/mm/dd/hh:mM:ss '),//Determines whether the input character array (' Superuser ', ' in ', ' range ' = = = Array (0, 1)),//Regular authenticator: arr Ay (' name ', ' match ', ' pattern ' = '/^[a-z0-9\-_]+$/'),//Digital Authenticator: Array (' ID ', ' numerical ', ' min ' =& gt;1, ' Max ' =>10, ' integeronly ' =>true),//type validation integer,float,string,array,date,time,datetime Array (' Created ', ' type ', ' datetime '),//file Validation: Array (' filename ', ' file ', ' AllowEmpty ' =>true, ' Types ' + ' zip, rar, xls, PDF, ppt ', ' toolarge ' + ' pictures do not exceed 800K '), array (' URL ', ' file ',/ /defined as file type ' AllowEmpty ' =>true, ' types ' = ' Jpg,png,gif,doc,docx,pdf,xls,xlsx,zip,rar, Ppt,pptx ',//upload file type ' maxSize ' =>1024*1024*10,//upload size limit, note not php.ini upload file size ' toolar GE ' + ' file is larger than 10M, upload failed! Please upload files less than 10M! ' ), } ); $news = new News (' Search '); Search Association Rules
The above describes the [php]yii rules, including the contents of the content, I hope the PHP tutorial interested in a friend helpful.