yii验证规则不起作用

时间:2015-11-21 15:58:07

标签: php yii

这是规则:

public function rules()
{
    // NOTE: you should only define rules for those attributes that
    // will receive user inputs.
    return array(
        array(
            'sPhone,phones, real_id',
            'safe'
        ),
        array(
            'phones, full_name',
            'required'
        ),
        array(
            'series_passports, passport_number, birthday, who_issued',
            'required',
            'on' => 'individual'
        ),
        array(
            'inn, ogrn, p_accounts, bank_name, bic_bank, corr_account, kpp, yurid_adress, fakt_adress, polnoe_fio_dir, v_lice_d_fio_rod',
            'required',
            'on' => 'entity'
        ),
        array('email', 'email'),
        array('email', 'checkEmailInRealTable', 'except'=>'temp'),
        array('birthday', 'date', 'format' => 'dd.MM.yyyy'),
        array('phones', 'phoneValidation'),
        array(
            'contact_person, fax, full_name, email, inn, ogrn, p_accounts, bank_name, bic_bank, corr_account, contractor, series_passports, birthday, who_issued, buyer, kpp, yurid_adress, fakt_adress, polnoe_fio_dir, v_lice_d_fio_rod',
            'length',
            'max' => 255
        ),
        // The following rule is used by search().
        // @todo Please remove those attributes that should not be searched.
        array(
            'id, contact_person, fax, full_name, email, inn, ogrn, p_accounts, bank_name, bic_bank, corr_account, contractor, series_passports,  birthday, who_issued, buyer, kpp, yurid_adress, fakt_adress, polnoe_fio_dir, v_lice_d_fio_rod',
            'safe',
            'on' => 'search'
        ),
        array(
            'id, contact_person, fax, full_name, email, inn, ogrn, p_accounts, bank_name, bic_bank, corr_account, contractor, series_passports,  birthday, who_issued, buyer',
            'safe',
            'on' => 'entity'
        ),
        array(
            'id, contact_person, fax, full_name, email, inn, ogrn, p_accounts, bank_name, bic_bank, corr_account, contractor, series_passports,  birthday, who_issued, buyer, kpp, yurid_adress, fakt_adress, polnoe_fio_dir, v_lice_d_fio_rod',
            'safe',
            'on' => 'models'
        ),
    );
}

服务器执行$ model->之后validate(),服务器脚本返回'500 Internal Server Error'。添加规则和字段后出现错误。我在规则中找不到错误:(

0 个答案:

没有答案