将类路径转换为.语法路径传递给AS[PHP]
define("ROOT_PATH","/xxx/yyy/zzz/");
function A (){
$this->rootPath = ROOT_PATH;
$this->file = __FILE__;
return $this->classRoot = basename(str_replace("/",".",str_replace("$this->rootPath" ,"", $this->file)),".php");
}
$this->rootPath = ROOT_PATH;
$this->file = __FILE__;
return $this->classRoot = basename(str_replace("/",".",str_replace("$this->rootPath" ,"", $this->file)),".php");
}
标签: php


0 条评论:
发表评论
指向此文章的链接:
创建链接
<< 主页