display error by function |
hi in my model i have this function :
Code: function login($email,$passwrd){ HOw can i show error in view ?
return the errors array. Then you can add it to your view like so: $this->load->view('your-view', ['errors' => $errors]);
Simpler is always better
(06-15-2017, 04:59 PM)donpwinston Wrote: return the errors array. Then you can add it to your view like so: $this->load->view('your-view', ['errors' => $errors]); This is my function on controller (simple function only to try): Code: public function index(){ But in my view i have : A PHP Error was encountered Severity: Notice Message: Undefined variable: errors Filename: controllers/User.php |
Welcome Guest, Not a member yet? Register Sign In |