Welcome Guest, Not a member yet? Register   Sign In
controller functions that are only accessible to jquery or ajax
#2

[eluser]Mirge[/eluser]
Keep your function accessible so that you can query it via AJAX, and in the controller itself, test if it's an ajax call via is_ajax_request(). See manual here, very bottom: http://ellislab.com/codeigniter/user-gui...input.html

An example might be something like:

Code:
public function get_cities()
{
     if(! $this->input->is_ajax_request())
          show_404();

     // Otherwise, proceed as usual!
}


Messages In This Thread
controller functions that are only accessible to jquery or ajax - by El Forum - 11-08-2012, 10:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB