取消 MODULE_PATH 常量 用 App::$modulePath 替代

This commit is contained in:
thinkphp
2016-06-14 14:57:12 +08:00
parent 09a7b91fef
commit 5e7c8e9902
4 changed files with 13 additions and 6 deletions

View File

@@ -11,6 +11,7 @@
namespace think\view\driver;
use think\App;
use think\exception\TemplateNotFoundException;
use think\Log;
use think\Request;
@@ -35,8 +36,8 @@ class Think
public function __construct($config = [])
{
$this->config = array_merge($this->config, $config);
if (empty($this->config['view_path']) && defined('MODULE_PATH')) {
$this->config['view_path'] = MODULE_PATH . 'view' . DS;
if (empty($this->config['view_path'])) {
$this->config['view_path'] = App::$modulePath . 'view' . DS;
}
$this->template = new Template($this->config);
}