如何在yii2中进行验证?

时间:2016-04-03 17:18:16

标签: php ajax yii2

如何在不点击表单按钮的情况下验证表单?

型号:

module counter4bits(
    ... input/output with no change
    reg [3:0] val_nxt;  // Not flip-flop but used in always @(*) thus reg

    always @(*) begin
        if (rst_n_i == 1)
            val_nxt = 0;
        else if(enable_i == 1)
            val_nxt = val_o + 1;
        end

    always @(posedge clk_i)
        val_o <= val_nxt;

endmodule

提交表单后,

1 个答案:

答案 0 :(得分:0)

我解决了:

public function rules() {
    return [
           ['CodeKargah', 'integer', 'min' => 100000000, 'tooSmall' => Yii::t('app', 'The value entered must be 10 digits.')],
           ['CodeKargah', 'match', 'pattern' => '/^0/'],
        // ...
        // ...
        // ...
    ];
}