* zin: fix createWg error

This commit is contained in:
Hao Sun
2023-02-27 15:07:54 +08:00
parent d5b589103f
commit 5f00f65884
4 changed files with 40 additions and 5 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
/**
* The render function file of zin of ZenTaoPMS.
*
* @copyright Copyright 2023 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @author Hao Sun <sunhao@easycorp.ltd>
* @package zin
* @version $Id
* @link https://www.zentao.net
*/
namespace zin;
$globalRenderList = array();
$isGlobalMode = true;
function enableGlobalRender()
{
global $isGlobalMode;
$isGlobalMode = true;
}
function disableGlobalRender()
{
global $isGlobalMode;
$isGlobalMode = false;
}
function render($wgName)
{
global $globalRenderList;
if(function_exists($wgName))
{
return call_user_func_array($wgName, $globalRenderList);
}
return class_exists($wgName) ? (new $wgName($globalRenderList)) : $wgName($globalRenderList);
}
-5
View File
@@ -49,10 +49,5 @@ function createWg($name, $args)
$wgName = "\\zin\\$name";
if(function_exists($wgName))
{
return call_user_func_array($wgName, $args);
}
return class_exists($wgName) ? (new $wgName($args)) : $wgName($args);
}
View File
View File