我有以下代码:
$this->form_validation->set_rules('pay', '', 'required', array("required" => "this field is required"));
我需要更改以验证大于0。
赞:
$this->form_validation->set_rules('pay', '', 'greater_than', array("greater_than" => "only values greater than 0"));
我该怎么做?
答案 0 :(得分:1)
您只需要添加类似的规则
$this->form_validation->set_rules('pay', '', 'required| greater_than[0]');