문제

In kohana 3.3 i need to include one of the controller file in the another controller

I used require_once( realpath(dirname(FILE) . '/Twitteroauth.php' ) );

Its showing the server error.

Thanks in advance.

도움이 되었습니까?

해결책

You should do this:

require_once( realpath(dirname(__FILE__) . '/Twitteroauth.php' ) );

다른 팁

Function realpath returns false when file does not exist, so you should maybe check result before require:

$path = realpath(dirname(__FILE__) . '/Twitteroauth.php' );
if(!empty($path))
    require_once($path);
else
    die("$path not found!");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top