From 264cf56ae46f40143c8ed5ed47bdbb6b86122ee8 Mon Sep 17 00:00:00 2001 From: wolfcode <37436228+wolf-leo@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:25:54 +0800 Subject: [PATCH] fix(View): automatically determine the template path if it is empty - Add logic to automatically set the template path based on the controller and action if not explicitly defined - Improve consistency in the 'iframeOpenTop' configuration by adding missing commas --- app/common/controller/AdminController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/common/controller/AdminController.php b/app/common/controller/AdminController.php index 99f826b..3fd7b17 100644 --- a/app/common/controller/AdminController.php +++ b/app/common/controller/AdminController.php @@ -133,6 +133,9 @@ class AdminController extends BaseController { if ($layout) View::instance()->engine()->layout('/layout/default'); View::assign($vars); + if (empty($template)) { + $template = strtolower(str_replace('.', '/', $this->request->controller()) . '/' . $this->request->action()); + } return View::fetch($template); } @@ -249,7 +252,7 @@ class AdminController extends BaseController 'version' => env('APP_DEBUG') ? time() : ConfigService::getVersion(), 'adminUploadUrl' => url('ajax/upload', [], false), 'adminEditor' => sysConfig('site', 'editor_type') ?: 'wangEditor', - 'iframeOpenTop' => sysConfig('site', 'iframe_open_top') ?: 0, + 'iframeOpenTop' => sysConfig('site', 'iframe_open_top') ?: 0, ]; View::assign($data); }