Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 522 Bytes

collections.md

File metadata and controls

20 lines (15 loc) · 522 Bytes

Collections

The CollectionType can be used to add/remove multiple entries of the same field or set of fields:

use Palmtree\Form\FormBuilder;

$builder = (new FormBuilder('collection_example'))
    ->add('names', 'collection', [
        'entry_type'    => 'text',
        'min_entries' => 1,
        'max_entries' => 4,
        'add_label' => 'Add person',
    ])
    ->add('submit', 'submit');

See the collection example for a more advanced use-case.

Return to index