Welcome Guest, Not a member yet? Register   Sign In
Advice needed.
#3

[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?


Messages In This Thread
Advice needed. - by El Forum - 02-11-2011, 09:55 AM
Advice needed. - by El Forum - 02-11-2011, 01:50 PM
Advice needed. - by El Forum - 02-12-2011, 04:46 AM
Advice needed. - by El Forum - 02-12-2011, 05:12 AM
Advice needed. - by El Forum - 02-15-2011, 02:23 AM
Advice needed. - by El Forum - 02-15-2011, 09:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB