[eluser]jiffier[/eluser]
Yes, I think the approach you're suggesting is to use, for example, /users/edit/{user_id} to process the GET, that will display the form, and then /users/save to process the form POST. I normally use the same URL for both, which forces me to do the check for form parameters in the controller method. So yes, I think it's a pretty good approach.
Another thing..
Say we have a from with a lot of input fields. When processing it, I do the following:
Code:
function save(){
$this->users->saveUser($user_id, $_POST);
}
And user_model is responsible of creating the data to insert, i.e:
Code:
$data['phone']=$_POST['phone'];
$this->db->insert('user', $data);
Wouldn't it be cool to be available to "bind" request parameters to domain model objects?, i.e:
Code:
<input type="text" name="user[phone]" />
So that we get a $user array already populated by CI, and that can be automatically stored in the db with something like:
Code:
$this->db->update('user', $user);
Thanks in advance,
--
Dani