src/Form/Form/Form.php
public function valid(array $values, $populate = true)
    {
        foreach($this->getElements() as $index => &$element) {
            if(!array_key_exists($index, $values)) {
                if(is_a($element, 'FrenchFrogs\Form\Element\Boolean')){
                    $values[$index] = 0;
                } else {
                    $values[$index] = '';
                }
            }

            $element->valid($values[$index]);

            if (!$element->isValid()) {
                $this->getValidator()->addError($index, $element->getErrorAsString());
            }

        }

        return $this;
    }
public function valid(array $values, $populate = true)
    {
        foreach($this->getElements() as $index => &$element) {
            if(!array_key_exists($index, $values)) {
                if(is_a($element, 'FrenchFrogs\Form\Element\Boolean')){
                    $values[$index] = 0;
                } else {
                    $values[$index] = '';
                }
            }

            $element->valid($values[$index]);

            if (!$element->isValid()) {
                $this->getValidator()->addError($index, $element->getErrorAsString());
            }

        }

        return $this;
    }
public function valid ( array $ values , $ populate = true ) { foreach ( $ this -> getElements ( ) as $ index => & $ element ) { if ( ! array_key_exists ( $ index , $ values ) ) { if ( is_a ( $ element , 'FrenchFrogs\Form\Element\Boolean' ) ) { $ values [ $ index ] = 0 ; } else { $ values [ $ index ] = '' ; } } $ element -> valid ( $ values [ $ index ] ) ; if ( ! $ element -> isValid ( ) ) { $ this -> getValidator ( ) -> addError ( $ index , $ element -> getErrorAsString ( ) ) ; } } return $ this ; }
Valid all the form elements

@param array $values
@param bool|true $populate
@return $this
Valid all the form elements