diff --git a/lib/zin/core/js.class.php b/lib/zin/core/js.class.php index 55ccfe61c3..07291c16aa 100644 --- a/lib/zin/core/js.class.php +++ b/lib/zin/core/js.class.php @@ -439,3 +439,16 @@ class js extends directive return $context->call(...$args); } } + +/** + * Create js object. + * 创建 JS 对象。 + * + * @access public + * @param null|string|js|array ...$codes Codes. + * @return js + */ +function js(null|string|js|array ...$codes): js +{ + return new js(...$codes); +}