CodeIgniter3 - supporting both API & Web requests in Controllers?
问题 I'm currently working with a CodeIgniter3 application, and have built the basis for a standard blog-like system. The structure is standard CI - User requests a page, page loads controller method, controller method calls any relevant DB functions from its model, and then a view is loaded. However, I'm looking to also make this view accessible via an API. So, instead of the $data array being filled with information to populate into HTML, I would instead pass it to a different view which would