Welcome Guest, Not a member yet? Register   Sign In
Call to a member function on bool
#2

(This post was last modified: 05-02-2021, 03:38 PM by includebeer.)

If you are calling this from a controller, you need to call the getError function like this:
PHP Code:
if(!$validation){
        $usrErr $this->validator->hasError('user') ? $this->validator->getError('user') : "";
            echo 'user: '.$usrErr;                


In your code, $validation is the result of the validation you just made. It's not an instance of the validation library.

See the "Validation data" section in the user guide: http://codeigniter.com/user_guide/incomi...ating-data
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
Call to a member function on bool - by mauroMbs - 05-02-2021, 01:41 PM
RE: Call to a member function on bool - by includebeer - 05-02-2021, 03:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB