From e1a086a06486591aa730d0fe06b5465b6bbd7ce0 Mon Sep 17 00:00:00 2001 From: Devil Date: Tue, 20 Jul 2021 23:46:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E5=9B=BE=20assign=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/common.php b/app/common.php index 431c80ab5..93f055bf8 100755 --- a/app/common.php +++ b/app/common.php @@ -118,12 +118,12 @@ function MyEventTrigger($key, $params = []) * @version 1.0.0 * @date 2021-07-16 * @desc description - * @param [string] $key [key名称] + * @param [string|array] $data [key名称|批量赋值(数组)] * @param [mixed] $value [数据值] */ -function MyViewAssign($key, $value) +function MyViewAssign($data, $value = '') { - \think\facade\View::assign($key, $value); + \think\facade\View::assign($data, $value); } /** @@ -134,11 +134,11 @@ function MyViewAssign($key, $value) * @date 2021-07-16 * @desc description * @param [string] $view [视图地址] - * @param [array] $params [输入参数] + * @param [array] $data [模板变量] */ -function MyView($view = '', $params = []) +function MyView($view = '', $data = []) { - return \think\facade\View::fetch($view, $params); + return \think\facade\View::fetch($view, $data); } /**