src/Framework/Form/AspiForm.php
public function addFieldsFromConfig(array $config)
    {
        $i = 1;
        foreach ($config as $name => $field) {
            if (is_numeric($name) && !isset($field[$name]['type'])) {
                $fields = [];
                foreach ($field as $n => $f) {
                    $fields[$n] = Fields::create($n, $f);
                }
                if ($i > 1) {
                    $this->fieldsets[$this->current]->createGroup();
                }
                $this->fieldsets[$this->current]->addFields($fields);
                $i++;
            } else {
                $this->addField(Fields::create($name, $field));
            }
        }
        return $this;
    }
public function addFieldsFromConfig(array $config)
    {
        $i = 1;
        foreach ($config as $name => $field) {
            if (is_numeric($name) && !isset($field[$name]['type'])) {
                $fields = [];
                foreach ($field as $n => $f) {
                    $fields[$n] = Fields::create($n, $f);
                }
                if ($i > 1) {
                    $this->fieldsets[$this->current]->createGroup();
                }
                $this->fieldsets[$this->current]->addFields($fields);
                $i++;
            } else {
                $this->addField(Fields::create($name, $field));
            }
        }
        return $this;
    }
public function addFieldsFromConfig ( array $ config ) { $ i = 1 ; foreach ( $ config as $ name => $ field ) { if ( is_numeric ( $ name ) && ! isset ( $ field [ $ name ] [ 'type' ] ) ) { $ fields = [ ] ; foreach ( $ field as $ n => $ f ) { $ fields [ $ n ] = Fields :: create ( $ n , $ f ) ; } if ( $ i > 1 ) { $ this -> fieldsets [ $ this -> current ] -> createGroup ( ) ; } $ this -> fieldsets [ $ this -> current ] -> addFields ( $ fields ) ; $ i ++ ; } else { $ this -> addField ( Fields :: create ( $ name , $ field ) ) ; } } return $ this ; }
Method to add form fields from config

@param  array $config
@return Form
Method to add form fields from config