让我们说我们有一个目录
script.php是一个从index.php扩展控制器类的类,
application/helloworld/script.php
index.php
有没有办法从index.php(控制器)返回文件夹helloworld?
编辑*
script.php的
class Helloworld extends Controller
{
function __construct()
{
echo 'helloworld';
}
}
的index.php
class Controller
{
function wherethescript(){
# trying to find folder where helloworld.php is in from this class
}
}
include_once 'application/helloworld/helloworld.php';
$x=new Helloworld;
$x->wherethescript();