public function section(string $title, array $fieldBindings)
    {
        InvalidArgumentException::verifyAllInstanceOf(__METHOD__, 'fieldBindings', $fieldBindings, FormFieldBindingDefinition::class);

        $fields = [];
        foreach ($fieldBindings as $fieldBinding) {
            $fields[] = $fieldBinding->getField();

            if ($fieldBinding->hasBinding()) {
                $this->currentStageFieldBindings[] = $fieldBinding->getBinding();
            }
        }

        $this->currentStageSections[] = new FormSection($title, $fields);
    }
public function section(string $title, array $fieldBindings)
    {
        InvalidArgumentException::verifyAllInstanceOf(__METHOD__, 'fieldBindings', $fieldBindings, FormFieldBindingDefinition::class);

        $fields = [];
        foreach ($fieldBindings as $fieldBinding) {
            $fields[] = $fieldBinding->getField();

            if ($fieldBinding->hasBinding()) {
                $this->currentStageFieldBindings[] = $fieldBinding->getBinding();
            }
        }

        $this->currentStageSections[] = new FormSection($title, $fields);
    }
public function section ( string $ title , array $ fieldBindings ) { InvalidArgumentException :: verifyAllInstanceOf ( __METHOD__ , 'fieldBindings' , $ fieldBindings , FormFieldBindingDefinition :: class ) ; $ fields = [ ] ; foreach ( $ fieldBindings as $ fieldBinding ) { $ fields [ ] = $ fieldBinding -> getField ( ) ; if ( $ fieldBinding -> hasBinding ( ) ) { $ this -> currentStageFieldBindings [ ] = $ fieldBinding -> getBinding ( ) ; } } $ this -> currentStageSections [ ] = new FormSection ( $ title , $ fields ) ; }
Defines a form section with the supplied form field bindings.

Example:
<code>
$form->section('Details', [
$form->field(
Field::name('name')->label('Name')->string()->required()
)->bindToProperty('name')
]);
</code>

@param string                       $title
@param FormFieldBindingDefinition[] $fieldBindings

@return void
@throws InvalidArgumentException
Defines a form section with the supplied form field bindings .