Skip to content

Commit

Permalink
更新数据
Browse files Browse the repository at this point in the history
  • Loading branch information
东流 committed Dec 20, 2017
1 parent 4755e84 commit df621b3
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions Yaf/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,20 @@ public function get($name = '')
$params = $_GET;
}

if($name != '' && isset($params[$name])){
$params = $params[$name];
$items = [];
if(count($params)!=0){
$items = [];
foreach ($params as $key => $value) {
$items[$key] = trim($value);
}
}
return $params;

if($name != '' && isset($items[$name])){
$items = $items[$name];
}


return $items;
}


Expand All @@ -77,9 +87,21 @@ public function Post($name='')
}else{
$params = $_POST;
}
if($name != '' && isset($params[$name])){
$params = $params[$name];


$items = [];
if(count($params)!=0){
$items = [];
foreach ($params as $key => $value) {
$items[$key] = trim($value);
}
}

if($name != '' && isset($items[$name])){
$items = $items[$name];
}


return $params;
}

Expand Down

0 comments on commit df621b3

Please sign in to comment.