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