Simple validation |
Hello, I have one noobie question. I just started to learn CI4. I would like to validate data in the array. For example...
$data = [ 'id' = 10, 'name' = 'whatever' ] $validation = \Config\Services::validation(); $validation->setRules([ 'id' => 'required', 'name' => 'required', ]); So how can now validate $data with rules listed above?
You use it like this, you can read more about it in the manual: https://codeigniter.com/user_guide/libra...ation.html
PHP Code: use CodeIgniter\Controller; |
Welcome Guest, Not a member yet? Register Sign In |