There are several different use cases for a CI user-defined controller. Commonly, the CI controller will handle initiating/rendering HTML pages, enable us to let the user navigate and view the different web application pages we defined. However, the controller may also provide other services, such as AJAX server-side controller, serving asynchronously the client-side browser requests, and commonly return back the JSON formatted data instead of a rendered view. The exact scope and usage of AJAX is not part of the CI framework, but it is very useful standard de-facto technology. To learn more about AJAX, please refer to AJAX (Asynchronous JavaScript and XML) on Wikipedia http://en.wikipedia.org.
The main usage categories for our controller in a CI framework are as follows:
Rendering views: These type of controllers mostly performs some preparations for data and render the requested view, along with the prepared data, to be displayed to the user for the next user session...