改进View 避免手动初始化engine的时候 view_path为空值

This commit is contained in:
thinkphp
2016-03-15 21:49:33 +08:00
parent f427e4d077
commit a880485ace

View File

@@ -118,7 +118,10 @@ class View
if ('php' == $engine) {
$this->engine = 'php';
} else {
$class = $this->config['namespace'] . ucwords($engine);
$class = $this->config['namespace'] . ucfirst($engine);
if (empty($this->config['view_path']) && defined('VIEW_PATH')) {
$this->config['view_path'] = VIEW_PATH;
}
$config = array_merge($config, [
'view_path' => $this->config['view_path'],
'view_suffix' => $this->config['view_suffix'],