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
This commit is contained in:
wolfcode
2025-01-08 14:25:54 +08:00
parent 57ea9a3f47
commit 264cf56ae4

View File

@@ -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);
}