Example #1
0
 public static function run($dataName, $key, $type, $default = NULL)
 {
     $val = validate::getData($dataName, $key);
     $arrType = explode('.', $type);
     if (2 === count($arrType)) {
         $data = [];
         if (TRUE === is_array($val)) {
             foreach ($val as $key => $value) {
                 if (FALSE === request::isEmpty($tmp = self::_run($value, $arrType[1]))) {
                     $data[$key] = $tmp;
                 }
             }
         }
         if (TRUE === request::isEmpty($data)) {
             return $default;
         }
         return $data;
     } else {
         return self::_run($val, $type, $default);
     }
 }