CodeIgniter Interview Questions

CodeIgniter Interview Questions Download CodeIgniter Interview Questions PDF

CodeIgniter Interview Questions

https://codeigniter-id.github.io/user-guide/helpers/url_helper.html

By default, all logs in Codeigniter are stored in logs/ directory. To enable error logging you must set the “threshold” for logging in application/config/config.php. Also, your logs/ must be writable.

$config['log_threshold'] = 1;

CLI is a text-based command-line interface for interacting with computers via a set of commands.

In Codeigniter, we can use CLI for

  • Run your cronjobs without needing to use wget or curl
  • Make your cron-jobs inaccessible from being loaded in the URL by checking the return value of is_cli().
  • Make interactive “tasks” that can do things like set permissions, prune cache folders, run backups, etc.
  • Helps to integrate Codeigniter with other applications in other languages. For example, a random C++ script could call one command and run code in your models!

CodeIgniter’s Hooks feature provides a way to modify the inner workings or functionality of the framework without hacking the core files.

The following is a list of available hook points.

  • pre_system Called very early during system execution.
  • pre_controller Called immediately prior to any of your controllers being called.
  • post_controller_constructor Called immediately after your controller is instantiated, but prior to any method calls happening.
  • post_controller Called immediately after your controller is fully executed.
  • display_override Overrides the _display() method.
  • cache_override Enables you to call your own method instead of the _display_cache() method in the Output Library. This permits you to use your own cache display mechanism.
  • post_system Called after the final rendered page is sent to the browser, at the end of system execution after the finalized data is sent to the browser.

Read More