From 0e1f77e0fad033048424d844c549baebd875b2db Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 27 Mar 2013 11:41:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0I=E6=96=B9=E6=B3=95=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E7=B3=BB=E7=BB=9F=E5=8F=98=E9=87=8F=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/base.php b/base.php index bd5f208a..9774af89 100644 --- a/base.php +++ b/base.php @@ -48,6 +48,16 @@ function C($name='',$range='') { return \Think\Config::get($name,$range); } +// 获取输入数据 +function I($key,$default,$filter) { + if(strpos($key,'.')) { // 指定参数来源 + list($method,$key) = explode('.',$key); + }else{ // 默认为自动判断 + $method = 'param'; + } + return \Think\Input::$method($key,$filter,$default); +} + /** * 记录和统计时间(微秒)和内存使用情况 * 使用方法: