这个文件就是extjs.php文件,其实这里名字并不重要,我已经做了处理,保证能拼接处想要的url。
但是还是建议使用extjs.php来命名,因为个觉得见名知意。
/*
* put this file with ext source code in the same folder
*
* such as :
* extjs/adapter/...
* extjs/resources/...
* extjs/ext-all.js
*
* extjs/extjs.php
* invoke code: require_once("./JS/extjs/extjs.php");
*/
$fileRelativePath = str_replace("//","/",substr(__FILE__,strlen($_SERVER['DOCUMENT_ROOT'])));
//JS/extjs/extjs.php
$serverUrl = "http://".$_SERVER[SERVER_NAME].":".$_SERVER[SERVER_PORT];
//http://192.168.1.56:81
$selfname = basename(__FILE__);
//extjs.php
$extpath = str_replace("/".$selfname,"",$serverUrl.$fileRelativePath);
?>
// -->
// -->