我正在使用CodeIgniter 4的验证表单,我已经检查了帖子是否到来,但每次都收到FALSE,请查看我的代码。
function login(){
helper(['form', 'url']);
$validation = \Config\Services::validation();
$validation->setRules([
'email' => ['label' => 'E-mail', 'rules' => 'required'],
'password' => ['label' => 'Senha', 'rules' => 'required|min_length[6]']
]);
var_dump($this->validate($validation) ? true : false);exit;
}
我也试过了,
$rules = [
'email' => ['label' => 'E-mail', 'rules' => 'required'],
'password' => ['label' => 'Senha', 'rules' => 'required|min_length[6]']
];
var_dump($this->validate($rules) ? true : false);exit;
2条答案
按热度按时间wfauudbj1#
看看我的密码
daolsyd02#
但前提是: