Example #1
0
 /**
  * Get the size of the field be it a number or a string
  * @param  string $attributes Field being tested
  * @param  mixed $value       Value held in field
  * @return mixed
  */
 protected function _size($field, $value)
 {
     if (is_numeric($value) and $this->_hasRule($field, $this->_numericRules)) {
         return $this->fields[$field];
     } else {
         if (RequestMethods::file($field)) {
             return $value['size'] / 1024;
         } else {
             return StringMethods::length(trim($value));
         }
     }
 }