From b50ae14b13f05b1f88b3cfe2e963d28e9aedf2e5 Mon Sep 17 00:00:00 2001 From: fengyuexingzi Date: Thu, 26 Oct 2017 21:30:40 +0800 Subject: [PATCH] modified: application/config.php modified: application/index/controller/Index.php --- application/config.php | 2 +- application/index/controller/Index.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/application/config.php b/application/config.php index 0e61c67..f2ba052 100644 --- a/application/config.php +++ b/application/config.php @@ -145,7 +145,7 @@ return [ 'view_replace_str' => [ '__PUBLIC__' => 'public', '__ROOT__' => '/', - '__RELATIVE_PATH__' => './', + '__RELATIVE_PATH__' => $_SERVER["SCRIPT_NAME"] . '/..', ], // 默认跳转页面对应的模板文件 diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index f4722e8..56eddf2 100644 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -13,10 +13,13 @@ class Index extends Base * */ - var_dump(getcwd()); + /* + var_dump(getcwd()); var_dump($_SERVER['PHP_SELF']); var_dump($_SERVER['DOCUMENT_ROOT']); var_dump(__DIR__); + var_dump($_SERVER['SCRIPT_NAME']); + */ $this->assign('__LIST__', [1, 2, 3]);