[eluser]animatora[/eluser]
Hi all, I recently bought this book of Jamie "Codeigniters hand book". There he is making some very good observations about how should a model and controller look like. Has anyone come across his Model implementation on github, I can't understand how to make data validation.
Lest say I have this in my controller:
Code:
public function create()
{
$data = array(
'email' => $this->input->post('email'),
'first_name' => $this->input->post('first_name')
);
// How to perform insertion here, so I can send back to my view success or error messages
// $this->model_name->create($data);
// OR I have to run validation from the model and then insert data.
}
My model has all the validation setup in the crete method I just call the super insert like:
Code:
public function create($data)
{
return $this->insert($data);
}
Any help is appreciated