1、更换编辑器

2、内核升级
This commit is contained in:
2016-12-10 12:21:08 +08:00
parent 766c26d25d
commit 06939cb0f1
389 changed files with 5944 additions and 41188 deletions

View File

@@ -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);
}
/**