CodeIgniter Forums
Extending Models - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Extending Models (/showthread.php?tid=7194)



Extending Models - El Forum - 03-29-2008

[eluser]edhrx[/eluser]
Hi,

Should this work as I am getting
Fatal error: Class 'General_model' not found in etc..
General_model does exist. Is this 'legal' in CI terms..

class Application_model extends General_model {

function application_model() {
//model constructor
parent::General_model();


}

best wishes ed


Extending Models - El Forum - 03-29-2008

[eluser]wiredesignz[/eluser]
Try this thread:
http://ellislab.com/forums/viewreply/374985/


Extending Models - El Forum - 03-29-2008

[eluser]m4rw3r[/eluser]
You have to include/require the General_model before you define the Application model.
You can use a normal require_once:
Code:
require_once './general_model.php';
class App_model extends General_model{
    // code ...