How do I replace front-end views with JSONs in Codeigniter 3? |
What about something like https://www.codeigniter.com/user_guide/l...ntent_type
Instead of loading any view at all, each controller method would build its "view data" as $data, and then $this->output->set_content_type('application/json')->set_output(json_encode($data)); |
Welcome Guest, Not a member yet? Register Sign In |