I'm developing a function that should enable users to update their personal information and I'm using CI form validation library. I'd want to know if what I'm doing is right.
public function updateDetails()
{
$this->load->model('users_model'); // load users model
$username = $this->input->post("username", true); // get the post from view
$this->form_validation->set_rules('username', 'Username', 'required|max_length[32]');
if($this->form_validation->run() === true)
{
// Send to model
}
}
Is this right? Or is there another method to do this?