From 12aa9704354d61ff7e180f4f2cb66e4330d4e3d1 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Wed, 29 Mar 2023 14:09:43 +0800 Subject: [PATCH] * zin: auto load zin view file if exists --- framework/base/control.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/framework/base/control.class.php b/framework/base/control.class.php index baead57293..13884ef2d7 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -915,6 +915,16 @@ class baseControl */ public function display($moduleName = '', $methodName = '') { + if($this->config->debug && $this->viewType === 'html' && (!isset($_GET['zin']) || $_GET['zin'] != '0')) + { + if(empty($moduleName)) $moduleName = $this->moduleName; + if(empty($methodName)) $methodName = $this->methodName; + $modulePath = $this->app->getModulePath($this->appName, $moduleName); + $viewType = $this->viewType == 'mhtml' ? 'html' : $this->viewType; + $mainViewFile = $modulePath . 'ui' . DS . $this->devicePrefix . $methodName . '.' . $viewType . '.php'; + if(file_exists($mainViewFile)) return $this->render($moduleName, $methodName); + } + if(empty($this->output)) $this->parse($moduleName, $methodName); echo $this->output; }