final public function getValidationRule($field): array
    {
        $rules = $this->rules();
        $response = [];

        foreach ($rules as $rule) {
            if (Any::isArray($rule[0])) { // 2 or more rules [['field1', 'field2'], 'filter', 'filter_argv']
                foreach ($rule[0] as $tfield) {
                    if ($tfield == $field) {
                        $response[$rule[1]] = $rule[2];
                    } // ['min_length' => 1, 'required' => null]
                }
            } else { // 1 rule ['field1', 'filter', 'filter_argv']
                if ($rule[0] === $field) {
                    $response[$rule[1]] = $rule[2];
                }
            }
        }

        return $response;
    }
final public function getValidationRule($field): array
    {
        $rules = $this->rules();
        $response = [];

        foreach ($rules as $rule) {
            if (Any::isArray($rule[0])) { // 2 or more rules [['field1', 'field2'], 'filter', 'filter_argv']
                foreach ($rule[0] as $tfield) {
                    if ($tfield == $field) {
                        $response[$rule[1]] = $rule[2];
                    } // ['min_length' => 1, 'required' => null]
                }
            } else { // 1 rule ['field1', 'filter', 'filter_argv']
                if ($rule[0] === $field) {
                    $response[$rule[1]] = $rule[2];
                }
            }
        }

        return $response;
    }
final public function getValidationRule ( $ field ) : array { $ rules = $ this -> rules ( ) ; $ response = [ ] ; foreach ( $ rules as $ rule ) { if ( Any :: isArray ( $ rule [ 0 ] ) ) { // 2 or more rules [['field1', 'field2'], 'filter', 'filter_argv'] foreach ( $ rule [ 0 ] as $ tfield ) { if ( $ tfield == $ field ) { $ response [ $ rule [ 1 ] ] = $ rule [ 2 ] ; } // ['min_length' => 1, 'required' => null] } } else { // 1 rule ['field1', 'filter', 'filter_argv'] if ( $ rule [ 0 ] === $ field ) { $ response [ $ rule [ 1 ] ] = $ rule [ 2 ] ; } } } return $ response ; }
Get validation rules for field
@param string $field
@return array
Get validation rules for field