0 votes
in CodeIgniter by
edited by

Can you extend native libraries in CodeIgniter?

🔗Source: CodeIgniter Interview Questions and Answers

🔗Source: JAVA Interview Questions and Answers

1 Answer

0 votes
by

Yes, we can add some extended functionality to a native library by adding one or two methods. It replaces the entire library with your version. So it is better to extend the class. Extending 

and replacing is almost identical with only following exceptions.

The class declaration must extend the parent class.

New class name and filename must be prefixed with MY_.

For example, to extend it to native Calendar, create a file MY_Calendar.php in application/libraries folder. Your class declared as class MY_Calendar extends CI_Calendar}

Related questions

0 votes
asked Dec 29, 2020 in CodeIgniter by SakshiSharma
0 votes
asked Dec 25, 2020 in CodeIgniter by SakshiSharma
...