Skip to content

Commit

Permalink
form
Browse files Browse the repository at this point in the history
  • Loading branch information
funadmin committed Jan 12, 2024
1 parent f7246be commit 892791a
Show file tree
Hide file tree
Showing 3 changed files with 505 additions and 452 deletions.
4 changes: 2 additions & 2 deletions src/addons/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public static function execute($addon = null, $controller = null, $action = null
}
// 监听addon_module_init
Event::trigger('addon_module_init', $request);
$class = get_addons_class($addon, 'controller', $controller,$module);
$class = get_addons_class($addon, 'controller', $controller);
if (!$class) {
throw new HttpException(404, lang('addon controller %s not found', [Str::studly($module.DS.$controller)]));
throw new HttpException(404, lang('addon controller %s not found', [Str::studly($addon.DS.$controller)]));
}
//加载app配置
// 重写视图基础路径
Expand Down
11 changes: 4 additions & 7 deletions src/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function get_addons_instance($name)
* @param string $class 当前类名
* @return string
*/
function get_addons_class($name, $type = 'hook', $class = null, $module = 'backend')
function get_addons_class($name, $type = 'hook', $class = null)
{
$name = trim($name);
// 处理多级控制器情况
Expand All @@ -232,14 +232,11 @@ function get_addons_class($name, $type = 'hook', $class = null, $module = 'backe
}
switch ($type) {
case 'controller':
if($module){
$namespace = '\\addons\\' . $name . '\\' . $module . '\\controller\\' . $class;
}else{
$namespace = '\\addons\\' . $name . '\\controller\\' . $class;
}
$namespace = '\\addons\\' . $name . '\\controller\\' . $class;
break;
default:
$namespace = '\\addons\\' . $name . '\\Plugin';
break;
}

return class_exists($namespace) ? $namespace : '';
Expand Down Expand Up @@ -1108,6 +1105,6 @@ function form_selectpage($name = 'selectpage', $list = [], $options = [], $value
*/
function form_autocomplete($name = 'autocomplete', $list = [], $options = [], $value=null)
{
return Form::autocomplete( $name, $list , $options ,$attr ,$value) ;
return Form::autocomplete( $name, $list , $options ,$value) ;
}
}
Loading

0 comments on commit 892791a

Please sign in to comment.