1、更换编辑器
2、内核升级
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
|
||||
namespace think;
|
||||
|
||||
use think\Loader;
|
||||
use think\Request;
|
||||
|
||||
class View
|
||||
{
|
||||
// 视图实例
|
||||
@@ -34,7 +37,21 @@ class View
|
||||
{
|
||||
// 初始化模板引擎
|
||||
$this->engine((array) $engine);
|
||||
$this->replace = $replace;
|
||||
// 基础替换字符串
|
||||
$request = Request::instance();
|
||||
$base = $request->root();
|
||||
$root = strpos($base, '.') ? ltrim(dirname($base), DS) : $base;
|
||||
if ('' != $root) {
|
||||
$root = '/' . ltrim($root, '/');
|
||||
}
|
||||
$baseReplace = [
|
||||
'__ROOT__' => $root,
|
||||
'__URL__' => $base . '/' . $request->module() . '/' . Loader::parseName($request->controller()),
|
||||
'__STATIC__' => $root . '/static',
|
||||
'__CSS__' => $root . '/static/css',
|
||||
'__JS__' => $root . '/static/js',
|
||||
];
|
||||
$this->replace = array_merge($baseReplace, (array) $replace);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user