Explain what helpers in CodeIgniter are and how you can load a helper file?
In CodeIgniter, helpers are group of function in a particular category that assist you to perform specific functions. In CodeIgniter, you will find many helpers like URL helpers- helping in creating links, Text helpers- perform various text formatting routines, Cookies- helpers set and read cookies. You can load helper file by using command $this->load->helper (‘name’) ;
Explain routing in Codeigniter?â€‹
In CodeIgniter, the way PHP files served is different rather than accessing it directly from the browser. This process is called routing. Routing in CodeIgniter gives you freedom to customize the default URL pattern to use our own URL pattern according to the requirement. So, whenever there is a request made and matches our URL pattern it will automatically direct to the specified controller and function.
Why is there a need to configure the URL routes?
Changing the URL routes has some benefits like
From SEO point of view, to make URL SEO friendly and get more user visits
Hide some URL element such as a function name, controller name, etc. from the users for security reasons
Provide different functionality to particular parts of a system
Explain Application Flow Chart in CodeIgniter?
The following graphic illustrates how data flows throughout the system:
(Give the following image explain the flow of CodeIgniter)
The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter.
The Router examines the HTTP request to determine what should be done with it.
If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
The Controller loads the model, core libraries, helpers, and any other resources needed to process the specific request.
The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so that on subsequent requests it can be served.
How to access config variable in codeigniter?
You can access config variable like:
How to unset session in codeigniter?
We can use unsetuserdata to destroy particular session variable
We can use sessdestroy to destroy all session:
How do you use aliases with autoloading models in CodeIgniter?
We can auto load model like this:
$autoload['model'] = array(array('usersmodel', 'users'), array('newsmodel', 'news'), 'categorymodel');
List out different types of hook point in CodeIgniter?
Different types of hook point in Codeigniter includes