Welcome Guest, Not a member yet? Register   Sign In
Core not autoloading
#6

[eluser]Colin Williams[/eluser]
Point your Ajax calls at a /controller/function/id URI and then in the controller function, just return to the Ajax what is needed. CI doesn't force you to output a full HTML. You can output XML, JSON, pieces of HTML, whatever you need. It's still just a request/response cycle, it just happens in the framework. You have full control over the response.

A very (very, very) crude example...

Code:
class User extends Controller {
  
   function ajax_index()
   {
      $users = $this->db->get('users');
      echo json_encode($users->result());
   }

}


Messages In This Thread
Core not autoloading - by El Forum - 05-26-2009, 04:07 PM
Core not autoloading - by El Forum - 05-26-2009, 05:05 PM
Core not autoloading - by El Forum - 05-26-2009, 05:27 PM
Core not autoloading - by El Forum - 05-26-2009, 06:41 PM
Core not autoloading - by El Forum - 05-27-2009, 03:50 PM
Core not autoloading - by El Forum - 05-27-2009, 04:04 PM
Core not autoloading - by El Forum - 05-28-2009, 10:28 PM
Core not autoloading - by El Forum - 05-28-2009, 11:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB