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

#1
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.
Reply

#2
Yes, make a base model and extend it.

models/Auth_model.php
class Auth_model extends MY_Model

core/MY_Model.php
class MY_Model extends CI_Model
Reply

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

#4
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.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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