Вопрос

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