Change class name

16 views
Skip to first unread message

Olof Glans

unread,
Oct 20, 2017, 6:54:49 AM10/20/17
to Fat-Free Framework
Changing a class name seem to make F3 not able to find it. Is there a way to work around this?

Here is my code:

config.cfg
AUTOLOAD=app/controllers/|app/repositories

Before:
  • app/controller/CtrlMessages.php 
    •   $this->repository = new Messages($f3); 
  • app/repositories/Messages.php 

After: 
  • app/controller/CtrlMessages.php 
    • $this->repository = new RepMessages($f3); 
  • app/repositories/RepMessages.php 
This gives the error: Class 'RepMessages' not found in CtrlMessages.php (where new Messages i called).

Sascha

unread,
Oct 20, 2017, 6:59:36 AM10/20/17
to Fat-Free Framework
The class name must match the file's name. Ohterwise it won't be able to find it automatically. You can either include the file manually or you have a different class in the same file matching the file's name which is initiated before.
Reply all
Reply to author
Forward
0 new messages