Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Extending \Fuel in 1.1 > Problem
  • Hi guys! I just started a new project on 1.1. Already started it on 1.0 but seeing that It just started and it's going to take some time I wanted the new stuff :) The problem I'm having is that I need to modify the "find_file" method in the Fuel controller... I could extend it in 1.0 but seems that I can't in 1.1... Any ideas how I can go around this? Or better idea to accomplish the following I have to modify the "find_file" method because It's the only way I've found to add DOCROOT and DOCROOT/modules directory to the paths array. I'm writing a system that overrides from docroot/modules > docroot > app/modules etc... I was hoping I could do this without touching the core code... Regards
  • Did you check out: Fuel::add_path() (docs, code) I've found the problem with Fuel class not being extendable, will be solved soon.
  • Thanks for the reply! I'm using modules so I have module_paths > APPPATH.'modules'.DS in the config. Then that gets added "first" in the paths array. But I need MY paths to come first... Any ideas? If I use add_path it gets added after apppath...
  • Or maybe just modify the core file until I can extend the Fuel class?
  • The core has been fixed. Did you read the docs btw? There's a param which allows you to make the new path prefixed, it's not really hidden or anything...
  • Well I did... But I was dumping the $paths array in the "find_file" method... There the app/modules is first even though I provide true in add_path method... I notice that If I dump the get_paths right after I add the paths they are right. My paths are first... But when I dump the paths in the find_file method the app\modules is added somewhere along the line to the "top". I'm a bit tiered so I'm sorry if this is just me being stupid. I apologise for it in advance and appreciate your help.
  • Sorry, forgot about that: Request paths (app & module) are added before the system-wide paths. You need this method to add paths to your request.
  • That did the trick! I didn't even know Request had this method... Thanks Fuel Maestro

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion