From 30a3d002c112eef810c6275e40df286d8994e24a Mon Sep 17 00:00:00 2001 From: sunhao Date: Fri, 19 Jan 2024 16:56:34 +0800 Subject: [PATCH] * zin: add js helper function to create js instance. --- lib/zin/core/js.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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); +}