mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-09-02 13:31:38 +08:00
Input类增加path、file、data方法,支持.语法取多维数组的值。
path方法在CI中测试报错,此方法的测试先关闭。
This commit is contained in:
@@ -32,9 +32,14 @@ function C($name = '', $value = null, $range = '')
|
||||
// 获取输入数据 支持默认值和过滤
|
||||
function I($key, $default = null, $filter = '')
|
||||
{
|
||||
if (strpos($key, '.')) {
|
||||
if ($pos = strpos($key, '.')) {
|
||||
// 指定参数来源
|
||||
list($method, $key) = explode('.', $key, 2);
|
||||
$method = substr($key, 0, $pos);
|
||||
if (in_array($method, ['get', 'post', 'put', 'param', 'request', 'session', 'cookie', 'server', 'globals', 'env', 'path', 'file', 'data'])) {
|
||||
$key = substr($key, $pos + 1);
|
||||
} else {
|
||||
$method = 'param';
|
||||
}
|
||||
} else {
|
||||
// 默认为自动判断
|
||||
$method = 'param';
|
||||
|
||||
Reference in New Issue
Block a user