[eluser]tpetrone[/eluser]
The data passed to the REST_Controller via REST methods (PUT/POST/GET/DELETE) are only accessible at the controller level. REST just extends the CONTROLLER class, so you pass values/arrays to models are you normally would..
The most basic way to get the data from a $this->post() to a $this->model is to...
Code:
$this->load->model('my_cool_model', cool_model);
$this->cool_model->do_something_with_my_post_data($this->post());
or
Code:
$this->load->model('my_cool_model', cool_model);
$this->cool_model->do_something_with_my_post_data($this->post('email'));
I also highly recommend that you sanitize the data before you send any PUT/POST/DELETE data to the controller.
Use the "normal" form validation for this..
Example:
Code:
if($this->delete('email')){
// why? Form Validation only works on $_POST
// Make sure the DELETE method values are form encoded
$_POST = $this->delete();
$this->form_validation->set_rules('email', 'Email', 'required');
if ( $this->form_validation->run() == FALSE )
{
// do something here when this test fails
} else {
$this->cool_model->do_something_cool_with_this_email($_POST['email']);
}
}
I am sure there are other ways to do this but simple is usually effective.