* set trace data to page data.

This commit is contained in:
sunhao
2023-04-27 18:50:31 +08:00
parent 2674f369f8
commit 2e94f1cabf
+8 -6
View File
@@ -975,7 +975,7 @@ class baseControl
$css = $this->getCSS($moduleName, $methodName, '.ui');
$js = $this->getJS($moduleName, $methodName, '.ui');
if($css) $this->view->pageCSS = $css;
if($js) $this->view->pageJS = $js;
if($js) $this->view->pageJS = $js;
/**
* 切换到视图文件所在的目录,以保证视图文件里面的include语句能够正常运行。
@@ -989,6 +989,13 @@ class baseControl
*/
\zin\zin::$data = (array)$this->view;
\zin\zin::$data['zinDebug'] = array();
if($this->config->debug && $this->config->debug >= 2)
{
\zin\zin::$data['zinDebug']['trace'] = $this->app->loadClass('trace')->getTrace();
}
/**
* 使用extract安定ob方法渲染$viewFile里面的代码。
* Use extract and ob functions to eval the codes in $viewFile.
@@ -1004,11 +1011,6 @@ class baseControl
ob_end_clean();
*/
if($this->config->debug && $this->config->debug >= 2)
{
$this->app->zinErrors[] = array('trace' => $this->app->loadClass('trace')->getTrace());
}
/**
* 渲染完毕后,再切换回之前的路径。
* At the end, chang the dir to the previous.