• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A part of my models would inherits an abstract class

Salut !

I want re-use same code for a group of model. Is it possible to make some models inherits a class and how to do this ?

In advance, thank you.

Yes, make a base model and extend it.

class Auth_model extends MY_Model

class MY_Model extends CI_Model

Thank you, but can we make few models class in core/  ?

You can make as many you want.
But then I would place them in /models/ instead. As it's not going to be extended by all your models.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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