mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
改进View类的root获取
This commit is contained in:
@@ -40,9 +40,9 @@ class View
|
|||||||
// 基础替换字符串
|
// 基础替换字符串
|
||||||
$request = Request::instance();
|
$request = Request::instance();
|
||||||
$base = $request->root();
|
$base = $request->root();
|
||||||
$root = strpos($base, '.') ? ltrim(dirname($base), '\\') : $base;
|
$root = strpos($base, '.') ? ltrim(dirname($base), DS) : $base;
|
||||||
if ('' != $root) {
|
if ('' != $root) {
|
||||||
$root = '/' . $root;
|
$root = '/' . ltrim($root, '/');
|
||||||
}
|
}
|
||||||
$baseReplace = [
|
$baseReplace = [
|
||||||
'__ROOT__' => $root,
|
'__ROOT__' => $root,
|
||||||
|
|||||||
Reference in New Issue
Block a user