Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Extending FUEL libraries

edited January 2011 in Modules
I'm still a bit new with CI and working with classes, so forgive me if this is a simple question.

I was wondering if it's possible to extend the libraries in the admin section like CI does with it's native classes so you could use the extended class by just loading the native one. I'm only curious because as updates are being made to the cms, I don't want to change a library and then the source code is updated. I hope that was sort of easy to understand. Thanks in advance.

-Justin

Comments

  • edited 10:26AM
    You could perhaps create a separate module folder and store your extended libraries in that module. Then you could load those in you code like so (where 'my_code' is your module folder name):
    $this->load->module_library('my_code', 'Menu');

    Alternatively, you could just put those libraries in your application/libraries folder.

    To extend them, you would need to first include the parent class to extend and then extend it. Does that make sense?
  • edited 10:26AM
    Yes, that does make sense, but then wouldn't I need to change every where the library is loaded to the extended file so I could have that functionality?
  • edited 10:26AM
    Yes, that is true. I guess it depends on what classes you are wanting to extend. If it's the core fuel classes and helpers, then it would be a little more work each time you want to upgrade.
  • edited 10:26AM
    Okay.. That's what I figured. The only one i'm looking to mess with now is the Fuel_auth because I want to create regular users for the front end. I guess I could separate them in their own module though. Thanks!
Sign In or Register to comment.