Welcome Guest, Not a member yet? Register   Sign In
Getting validation message from Model to view
#2

[eluser]Pert[/eluser]
Instead of returning false, return error message as non-boolean variable. It can be string or it could be array of errors.

Then in controller do this:

Code:
$result = $this->contact_model->information_post();

if ($result === true)
{
   // validation passed
}
else
{
   $this->data[‘title’] = ‘Information Desk’;
   $this->data[‘message’] = $result;
   $this->layout->show(‘contact/information_view’, $this->data);
}

PS, make sure to use === instead of ==


Messages In This Thread
Getting validation message from Model to view - by El Forum - 05-31-2013, 12:33 PM
Getting validation message from Model to view - by El Forum - 06-02-2013, 04:46 AM
Getting validation message from Model to view - by El Forum - 06-02-2013, 04:54 AM
Getting validation message from Model to view - by El Forum - 06-03-2013, 12:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB