[eluser]robnecciai[/eluser]
New to CI. I'm building a rather large site and, while I'm laying the groundwork, I have discovered that there are many posts on this forum that show example of using input->post methods directly within data models. Is this "best practices"?
example (in a data model):
function insert()
{
$data = array('userName' => $this->input->post('username'), 'age' => $this->input->post('age'));
$this->db->insert('member', $data);
}
If this is okay, can I also assume that it would be ok to traverse the input->post() array and "dynamically" build the data array to pass to the db->insert function?
I'm just looking for a good, solid, and fairly generic pattern for performing these actions.