質問

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