<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Util; use ModStart\Core\Exception\BizException; class MemberParamUtil { public static function param() { return array('{id}' => '用户ID', '{username}' => '用户名'); } public static function replaceParam($MPmfx, $J09PA) { goto iIyb2; KHvgd: $zDRuJ = array('id', 'username'); goto VRNol; iIyb2: BizException::throwsIfEmpty('用户为空', $J09PA); goto Y9IEw; VRNol: $EPwwc = array(); goto NRnzp; Y9IEw: if (!is_array($J09PA)) { $J09PA = MemberUtil::getCached($J09PA); } goto KHvgd; Go12j: return str_replace(array_keys($EPwwc), array_values($EPwwc), $MPmfx); goto WpK9I; NRnzp: foreach ($zDRuJ as $MFVkb) { $EPwwc['{' . $MFVkb . '}'] = isset($J09PA[$MFVkb]) ? $J09PA[$MFVkb] : ''; } goto Go12j; WpK9I: } public static function paramTitle() { return '<a href="javascript:;" data-dialog-request="' . modstart_admin_url('member/config/param') . '"><i class="iconfont icon-code"></i> 动态变量</a>'; } }