protected function validateElement($field, $handler_id, $arguments = array())
    {
        if (is_array($field)) {
            $label = reset($field);
            $field = key($field);
        }

        $options = array(
            'field' => $field,
            'arguments' => (array) $arguments,
            'label' => empty($label) ? $this->text('Field') : $label
        );

        $result = $this->validator->run($handler_id, $this->submitted, $options);

        if ($result === true) {
            return true;
        }

        settype($result, 'array');
        $this->errors = gplcart_array_merge($this->errors, $result);
        return false;
    }
protected function validateElement($field, $handler_id, $arguments = array())
    {
        if (is_array($field)) {
            $label = reset($field);
            $field = key($field);
        }

        $options = array(
            'field' => $field,
            'arguments' => (array) $arguments,
            'label' => empty($label) ? $this->text('Field') : $label
        );

        $result = $this->validator->run($handler_id, $this->submitted, $options);

        if ($result === true) {
            return true;
        }

        settype($result, 'array');
        $this->errors = gplcart_array_merge($this->errors, $result);
        return false;
    }
protected function validateElement ( $ field , $ handler_id , $ arguments = array ( ) ) { if ( is_array ( $ field ) ) { $ label = reset ( $ field ) ; $ field = key ( $ field ) ; } $ options = array ( 'field' => $ field , 'arguments' => ( array ) $ arguments , 'label' => empty ( $ label ) ? $ this -> text ( 'Field' ) : $ label ) ; $ result = $ this -> validator -> run ( $ handler_id , $ this -> submitted , $ options ) ; if ( $ result === true ) { return true ; } settype ( $ result , 'array' ) ; $ this -> errors = gplcart_array_merge ( $ this -> errors , $ result ) ; return false ; }
Validates a single element
@param string|array $field
@param string $handler_id
@param string|array $arguments
@return boolean
Validates a single element