File and class inclusion
The Fat Free Way of including files is to use AUTOLOAD
. This can be done in two ways:
(a) setting the AUTOLOAD
variable in index.php
:
$f3->set('AUTOLOAD', 'relativepathfromindex/routes.php; relativepathfromindexpath/globals.php');
(b) adding the AUTOLOAD
variable to the config.ini
file:
AUTOLOAD=relativepathfromindex/routes.php; relativepathfromindexpath/globals.php
then ensuring the config.ini
file is referenced in index.php
:
$f3->config('config.ini');
This is a great way to include all controllers for example in one go by adding something like the following to the config.ini
:
AUTOLOAD=controllers/
Globals
From your file names however you appear to perhaps be using globals, which may include something like:
define("LOGLEVEL", "DEBUG");
The Fat Free Framework does not support this syntax, so use the same method described above using either a set in index.php
(Fat Free recommends switching to CamelCase):
$f3->set('logLevel', 'DEBUG');
or adding it to config.ini
:
logLevel=DEBUG
Routes
If you want to reference routes outside index.php
, you will have to amend something like the following:
$f3->route('GET /@controller/@action','@controller->@action');
to a different format as you probably won't have $f3
declared:
Base::instance()->route('GET /@controller/@action','@controller->@action');