Extend MY_Model

edited November 2015 in News & Announcements
how can i extend the MY_Model in modules/fuel/core/MY_Model.php using fuel/application/core/MY_Model.php

Comments

  • edited 12:38PM
    Their are a couple model classes already that are used for modules and extend MY_Model (MY_Model, fuel/modules/fuel/models/Base_module_model.php and fuel/modules/fuel/models/Base_posts_model.php). Their files look similar to the following:
    require_once(APPPATH.'core/MY_Model.php'); class Base_module_model extends MY_Model { ...
    In fact you may want to actually extend one of those file which has some additional methods geared towards module models you may want to include.
    require_once(FUEL_PATH.'models/base_module_model.php'); class Base_model extends Base_module_model { ...
    Then for your models you extend your model instead:
    require_once(APPPATH.'models/new_base_model.php'); class News_model extends Base_model { ...
Sign In or Register to comment.