mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-09-03 13:51:38 +08:00
改进template类parseTemplateFile方法支持跨模块调用模板
route类method路由参数支持使用 GET|POST 选择多种请求
This commit is contained in:
@@ -727,10 +727,10 @@ class Template
|
||||
case 'array': // 识别为数组
|
||||
$parseStr = $first . '[\'' . implode('\'][\'', $vars) . '\']';
|
||||
break;
|
||||
case 'obj': // 识别为对象
|
||||
case 'obj': // 识别为对象
|
||||
$parseStr = $first . '->' . implode('->', $vars);
|
||||
break;
|
||||
default: // 自动判断数组或对象 只支持二维
|
||||
default: // 自动判断数组或对象 只支持二维
|
||||
$parseStr = 'is_array(' . $first . ')?' . $first . '[\'' . implode('\'][\'', $vars) . '\']:' . $first . '->' . implode('->', $vars);
|
||||
}
|
||||
}
|
||||
@@ -917,10 +917,12 @@ class Template
|
||||
private function parseTemplateFile($template)
|
||||
{
|
||||
if (false === strpos($template, '.')) {
|
||||
return (defined('THEME_PATH') && substr_count($template, '/') < 2 ? THEME_PATH : $this->config['tpl_path']) . $template . $this->config['tpl_suffix'];
|
||||
} else {
|
||||
return $template;
|
||||
// 跨模块支持
|
||||
$template = strpos($template, '@') ?
|
||||
APP_PATH . str_replace('@', '/' . basename($this->config['tpl_path']) . '/', $template) . $this->config['tpl_suffix'] :
|
||||
(defined('THEME_PATH') && substr_count($template, '/') < 2 ? THEME_PATH : $this->config['tpl_path']) . $template . $this->config['tpl_suffix'];
|
||||
}
|
||||
return $template;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user