src/Type/CollectionType.php
protected function processFieldsCollection($fieldCollection, $data, FormHandler $formHandler)
    {
        $fields = array();
        foreach ($fieldCollection as $field) {
            // Unnamed array fields
            if ($field['name'] === null) {
                if (!isset($i)) $i = 0;

                $field['name'] = $i;
                $field = $this->typeHandler->makeView($field, $data, $formHandler);
                $fields[] = $field;

                $i++;
            }
            // Named array fields
            else {
                $fieldName = $field['name'];
                $field = $this->typeHandler->makeView($field, $data, $formHandler);

                $field['has_error'] = false;
                if ($formHandler->fieldHasError($field['name'])) {
                    $field['has_error'] = true;
                }

                $fields[$fieldName] = $field;
            }
        }

        return $fields;
    }
protected function processFieldsCollection($fieldCollection, $data, FormHandler $formHandler)
    {
        $fields = array();
        foreach ($fieldCollection as $field) {
            // Unnamed array fields
            if ($field['name'] === null) {
                if (!isset($i)) $i = 0;

                $field['name'] = $i;
                $field = $this->typeHandler->makeView($field, $data, $formHandler);
                $fields[] = $field;

                $i++;
            }
            // Named array fields
            else {
                $fieldName = $field['name'];
                $field = $this->typeHandler->makeView($field, $data, $formHandler);

                $field['has_error'] = false;
                if ($formHandler->fieldHasError($field['name'])) {
                    $field['has_error'] = true;
                }

                $fields[$fieldName] = $field;
            }
        }

        return $fields;
    }
protected function processFieldsCollection ( $ fieldCollection , $ data , FormHandler $ formHandler ) { $ fields = array ( ) ; foreach ( $ fieldCollection as $ field ) { // Unnamed array fields if ( $ field [ 'name' ] === null ) { if ( ! isset ( $ i ) ) $ i = 0 ; $ field [ 'name' ] = $ i ; $ field = $ this -> typeHandler -> makeView ( $ field , $ data , $ formHandler ) ; $ fields [ ] = $ field ; $ i ++ ; } // Named array fields else { $ fieldName = $ field [ 'name' ] ; $ field = $ this -> typeHandler -> makeView ( $ field , $ data , $ formHandler ) ; $ field [ 'has_error' ] = false ; if ( $ formHandler -> fieldHasError ( $ field [ 'name' ] ) ) { $ field [ 'has_error' ] = true ; } $ fields [ $ fieldName ] = $ field ; } } return $ fields ; }
Process a collection of fields

@param $fieldCollection
@param $data
@param \AV\Form\FormHandler $formHandler
@return array
Process a collection of fields