Question

my file structure for phalcon is something like this

--app
-----controllers
-----models
-----views
-----functions
-----libraries

where functions and libraries folder contains some third party scripts like facebook log in etc, when I include the script in my controller classes, I did

include "../functions/facebook.php"

but it gives a file not found error.

How should I include files in the controller classes?

Was it helpful?

Solution

Ideally you should be using an autoloader Phalcon provides for automatically loading classes.

For non-classes, did you try using full path?

include __DIR__ . "/../functions/facebook.php";
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top