模型中的rules方法问题 [ 新手入门 ]
public function rules()
{
    return array(			
        array('username, password, password2, email, phonenum', 'required','message'=>' {attribute}不可为空.','on'=>'create'),
        array('username','length', 'max'=>20),
        array('username','unique'),
        array('password2','compare','compareAttribute'=>'password','message'=>' 两次输入的密码不一致..','on'=>'create'),
        array('email', 'email'),
        array('icon', 'safe'),
        // The following rule is used by search().
        // Please remove those attributes that should not be searched.
        array('id, username, password, email, phonenum', 'safe', 'on'=>'search'),
    );
}
请问类似的'on'=>'search',其中search是根据哪里来的,我有个方法是public function actionCreate(),那我应该写成 'on'=>'create’ 就可以了吗?还是应该怎么写?谢谢!
共 2 条回复
edubob
            注册时间:2012-10-16
最后登录:1970-01-01
在线时长:0小时0分
    最后登录:1970-01-01
在线时长:0小时0分
- 粉丝0
 - 金钱140
 - 威望0
 - 积分140