[eluser]chefnelone[/eluser]
[quote author="Rolly1971" date="1297475424"]What you could do is have 3 primary models:
MY_Model - This should only have functions that are gonna be common to everything.
Admin_Model - Functions for your back end, extends MY_Model
Public_Model - Functions for the front end, extends MY_Model
then load the appropriate model as needed.[/quote]
I put the 3 of them: MY_Model, Admin_Model and Public_Model in:
application/libraries/ (I'm still in ci1.7)
And I have Back_Model in
application/models
Then I call back_Model which extends to Admin_Model which extends to MY_Model:
Code:
<?php //in application/models
class Back_Model extends Admin_Model{
...
Code:
<?php //in application/libraries
class Admin_Model extends MY_Model{
...
Code:
<?php //in application/libraries
class MY_Model extends Model{
...
but I get this error:
Code:
ErrorException [ Fatal Error ]: Class 'MY_Model' not found
APPPATH/libraries/Admin_Model.php [ 2 ]
1 <?php
2 class Admin_Model extends MY_Model{
Is this what you meant?
What's wrong?