mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
模块 操作的URL访问取消强制转换 修正Build类
This commit is contained in:
@@ -102,8 +102,8 @@ class App
|
||||
$callable = self::$dispatch['callable'];
|
||||
if (is_callable($callable)) {
|
||||
$data = is_array($callable) ?
|
||||
self::reflectionInvoke(new $callable[0], $callable[1]) : // 数组定义需要实例化的对象和方法
|
||||
call_user_func_array($callable, self::$dispatch['params']); // 静态方法或者函数
|
||||
self::reflectionInvoke(new $callable[0], $callable[1]) : // 数组定义需要实例化的对象和方法
|
||||
call_user_func_array($callable, self::$dispatch['params']); // 静态方法或者函数
|
||||
} else {
|
||||
throw new Exception('not callable : ' . (is_array($callable) ? implode('->', $callable) : $callable), 10009);
|
||||
}
|
||||
@@ -166,7 +166,7 @@ class App
|
||||
{
|
||||
if (APP_MULTI_MODULE) {
|
||||
// 多模块部署
|
||||
$module = strtolower($result[0] ?: $config['default_module']);
|
||||
$module = $result[0] ?: $config['default_module'];
|
||||
if ($maps = $config['url_module_map']) {
|
||||
if (isset($maps[$module])) {
|
||||
// 记录当前别名
|
||||
@@ -204,7 +204,7 @@ class App
|
||||
define('CONTROLLER_NAME', defined('BIND_CONTROLLER') ? BIND_CONTROLLER : $controller);
|
||||
|
||||
// 获取操作名
|
||||
$action = strip_tags(strtolower($result[2] ?: Config::get('default_action')));
|
||||
$action = strip_tags($result[2] ?: Config::get('default_action'));
|
||||
define('ACTION_NAME', defined('BIND_ACTION') ? BIND_ACTION : $action);
|
||||
|
||||
// 执行操作
|
||||
|
||||
@@ -133,7 +133,7 @@ class Build
|
||||
$filename = APP_PATH . ($module ? $module . DS : '') . CONTROLLER_LAYER . DS . Config::get('default_controller') . EXT;
|
||||
if (!is_file($filename)) {
|
||||
$content = file_get_contents(THINK_PATH . 'tpl' . DS . 'default_index.tpl');
|
||||
$content = str_replace(['{$app}', '{$module}'], [APP_NAMESPACE, $module ? $module . '\\' : ''], $content);
|
||||
$content = str_replace(['{$app}', '{$module}', '{layer}'], [APP_NAMESPACE, $module ? $module . '\\' : '', CONTROLLER_LAYER], $content);
|
||||
if (!is_dir(dirname($filename))) {
|
||||
mkdir(dirname($filename), 0777, true);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace {$app}\{$module}controller;
|
||||
namespace {$app}\{$module}{layer};
|
||||
|
||||
class Index
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user