Congratulations on the CodeIgniter 4 video! I would like to know how to decide between validating field data directly in the entity's Modal class or using the validation done before, in the Controller, using the config that would be declared in the Config/Validation.php file or even in another local this setting?
Bro, the code in your video is not working. I think the validation library has changed in CI 4.1.4. The code "display_error($validation,'username')" generate undefined variable for $validation on loading the form. This is because the variable $validation is only created if there are validation errors.
The error "Undefined variable $validation", is occurring because the $data array is being passed to the view only for else condition. To resolve this, you need to make sure that the $data array is always passed to the view. Just add one line in your controller function "$data['validation'] = null;" after the "$data = [];" Also, you have to add the get and post routes i.e $routes->get('formvalidation', 'FormValidation::index'); $routes->post('formvalidation', 'FormValidation::index'); I hope this will resolve the issue.
sir i am facing an error called ErrorException Undefined variable: validation showing in my span when i am using the logic for every field its working correctly. but using it with span it showing me error.
$this->request->getMethod() this method is working is fine for us in latest version and old versions Can you tell me, where exactly you are getting the problem
@@GoPHP sir can you please help me with one question. I want to get country data from databases and. when I'm going to sign in after that I want to store this country name into a database how can I do this can you please suggest me something or please help me..