mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
去掉 VIEW_PATH 常量定义
This commit is contained in:
@@ -243,8 +243,6 @@ class App
|
|||||||
|
|
||||||
// 模块初始化
|
// 模块初始化
|
||||||
if ($module && $available) {
|
if ($module && $available) {
|
||||||
define('MODULE_PATH', APP_PATH . $module . DS);
|
|
||||||
define('VIEW_PATH', MODULE_PATH . 'view' . DS);
|
|
||||||
// 初始化模块
|
// 初始化模块
|
||||||
$config = self::initModule($module, $config);
|
$config = self::initModule($module, $config);
|
||||||
} else {
|
} else {
|
||||||
@@ -253,9 +251,9 @@ class App
|
|||||||
} else {
|
} else {
|
||||||
// 单一模块部署
|
// 单一模块部署
|
||||||
$module = '';
|
$module = '';
|
||||||
define('MODULE_PATH', APP_PATH);
|
|
||||||
define('VIEW_PATH', MODULE_PATH . 'view' . DS);
|
|
||||||
}
|
}
|
||||||
|
// 当前模块路径
|
||||||
|
define('MODULE_PATH', APP_PATH . ($module ? $module . DS : ''));
|
||||||
|
|
||||||
// 获取控制器名
|
// 获取控制器名
|
||||||
$controller = strip_tags($result[1] ?: $config['default_controller']);
|
$controller = strip_tags($result[1] ?: $config['default_controller']);
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ class Php
|
|||||||
*/
|
*/
|
||||||
private function parseTemplate($template)
|
private function parseTemplate($template)
|
||||||
{
|
{
|
||||||
if (empty($this->config['view_path']) && defined('VIEW_PATH')) {
|
if (empty($this->config['view_path']) && defined('MODULE_PATH')) {
|
||||||
$this->config['view_path'] = VIEW_PATH;
|
$this->config['view_path'] = MODULE_PATH . 'view' . DS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($template, '@')) {
|
if (strpos($template, '@')) {
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ class Think
|
|||||||
public function __construct($config = [])
|
public function __construct($config = [])
|
||||||
{
|
{
|
||||||
$this->config = array_merge($this->config, $config);
|
$this->config = array_merge($this->config, $config);
|
||||||
if (empty($this->config['view_path']) && defined('VIEW_PATH')) {
|
if (empty($this->config['view_path']) && defined('MODULE_PATH')) {
|
||||||
$this->config['view_path'] = VIEW_PATH;
|
$this->config['view_path'] = MODULE_PATH . 'view' . DS;
|
||||||
}
|
}
|
||||||
$this->template = new Template($this->config);
|
$this->template = new Template($this->config);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user