Inheritance in codeigniter

I am new to codeigniter. I want to know whether inheritance or polymorphism is used in codeigniter?If yes,can any one explain how it is?

Yes, just as it is in all PHP programs.

With regards to inheritance itself, you can extend the controller or model base class (see "Extending Core" in guide) and libraries as well.

For polymorphism, you probably want to create a model that acts as the factory and include the target classes in the same file for creation by the model-extending class.

Thank you for your quick reply richthegeek.
So you said for polymorphism,i have to include the necessary classes in a model,right?

You don't have to, but otherwise you'd have to load them by other means (includes etc) which can be a bit of a PITA for no gain.

thank you for your help and hope you will continue in future

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.