gump validator

This commit is contained in:
sHa
2018-02-12 14:01:31 +02:00
parent 7eee0fb80e
commit 6f8fb693a1

View File

@@ -3,7 +3,7 @@
* *
* @author sHa <sha@shadoll.com> * @author sHa <sha@shadoll.com>
* @package sLetter * @package sLetter
* @version 18.2.13-7 * @version 18.2.13-8
* *
*/ */
@@ -132,12 +132,11 @@ class sLetter{
} }
function validate($data,$return=false){ function validate($data,$return=false){
if(!empty($data) && is_array($data)) $is_valid = GUMP::is_valid($this->fields, $data);
foreach($data as $val) if($is_valid !== true){
if(empty($val)){ $this->error = true;
$this->error = true; $this->status = $is_valid;
$this->status = "Empty value"; }
}
return $return?$this->error:$this; return $return?$this->error:$this;
} }