[eluser]Kraig[/eluser]
Do you put is_ajax_requested in MY_Controller that way you can access it from all of your controllers?
Code:
public function is_ajax_request()
{
return ($this->server('HTTP_X_REQUESTED_WITH') === 'XMLHttpRequest');
}
So this is for ajax, how would you do a normal post form submission so you can do this...I put question marks because not all posts will have the same parameter
Code:
if ($this->input->is_ajax_request() || $this->input->post(???) )
{
// AJAX request stops here
exit(json_encode($data));
}
Also do you put all of your ajax requests and form submission functions into the same controller, or do you keep them in their perspective controller?