To connect database manually use following syntax, $this->load->database();
CodeIgniter Interview Questions
There are many purposes for which the URL routes are configured. To improve the number of page visits. To hide the code complexities from the user.
View folder contains all the markup files like header, footer, sidebar, etc. They can be reused by embedding them anywhere in controller file. They can’t call directly, and they have to be loaded in the controller’s file.
The Hook is a feature in CodeIgniter that provides a way to change the inner working of the framework without hacking the core files. It facilitates you to execute a script with a particular path within the CodeIgniter. Usually, it is defined in the application/config/hooks.php file.
The View can’t be accessed directly. It is always loaded in the controller file. Following function is used to load a view page: $this->load->view(‘page_name’); Write your view’s page name in the bracket. You don’t need to specify .php unless you are using some other extension.
To enable hook, go to application/config/config.php/ file and set it TRUE as shown below, $config[‘enable_hooks’] = TRUE;
A controller is the intermediary between models and views to process the HTTP request and generates a web page. It is the center of every request on your web application. Consider following URI, abc.com/index.php/front/ In this URI, CodeIgniter try to find Front.php file and Front class.
A list of different types of hook points in CodeIgniter: post_controller_constructor – It is called immediately after your controller is started but before any method call. pre_controller – It is called immediately before your controller being called. At this point, all the classes, security checks, and routing have been done. post_sytem – It is called …
The file specified in the default controller loaded by default when no file name is mentioned in the URL. By default, it is welcome.php which is the first page to be seen after installing CodeIgniter. With URL localhost/codeigniter/ Welcome.php will be loaded as there is no file name mentioned in the URL. Although as per …
These are a particular type of library that has a parent class and many child classes. These child classes have access to the parent class, but not to their siblings. Drivers are found in system/libraries folder.