fsv / sortable-collection-type-bundle
Symfony sortable collection form type
Installs: 1 960
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
Open Issues: 0
pkg:composer/fsv/sortable-collection-type-bundle
Requires
- php: >=5.5.9
- symfony/symfony: ^2.7|^3.0
Requires (Dev)
- phpunit/phpunit: ~4.8
This package is not auto-updated.
Last update: 2022-10-15 08:40:54 UTC
README
The bundle is used to sort the FormView objects in the CollectionType.
Sorting is based on the value of the specified property.
The property is determined by the property path in the format of the Symfony PropertyAccess component.
Installation
$ composer require fsv/sortable-collection-type-bundle
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Fsv\SortableCollectionTypeBundle\FsvSortableCollectionTypeBundle(), ); }
Configuration
The bundle does not have any configurable parameters.
Usage
// AppBundle\Form\Type\ExampleFormType.php public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('collection', CollectionType::class, [ // ... 'sort_by' => [ 'property' => 'asc' ] ]); // ... }