1.

What is meant by a library? How can you load a library in CodeIgniter?

Answer»
  • Libraries are packages created in PHP that give higher-level ABSTRACTIONS and thus contribute to faster development. This removes the NECESSITY of focusing on small, minute details by taking care of those by themselves.
  • Three methods are available to create a library:
    • Create an entirely new library
    • Extend native libraries
    • Replace native libraries
  • To load a library in CodeIgniter, you have to include the below code inside a controller: $this->load->library(‘class_name’);
  • All pre-defined libraries developed by CodeIgniter can be obtained at the system/libraries directory.
  • For LOADING multiple libraries at the same time, you can MAKE use of the same code. But replace the parameter with an array for loading multiple libraries.
$this->load->library(array(‘library1’, ‘library2’));


Discussion

No Comment Found