Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Autoloader custom directories in APPPATH
  • Hi I'm trying to add the directory
    fuel/app/classes/repository to the autoloader path can find classes such as Repository_Forum in fuel/app/classes/repository/forum.php
    Repository_Shop in fuel/app/classes/repository/shop.php
    etc. but how do I set up the bootstrap file so the autoloader can find these classes...
    and furthermore does the repository classes need to be in a certain namespace .? // thanks in advance
  • You don't need to. Anything in classes can be loaded by the autoloader as long as you follow the rules. And the examples you give do that, so they should be loaded without problems. If they are in the global namespace, the class name would be "Repository_Forum". It can also be in the namespace "Repository", with class name "Forum". Both will resolve to classes/repository/forum.php.
  • Thank you very much, I thought I have tried that already
    but it turns out I apparently haven't. Some times you can stare yourself blind on the code. But your solution worked. :D

Howdy, Stranger!

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

In this Discussion