문제

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?

도움이 되었습니까?

해결책

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";
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top