fsv/sortable-collection-type-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Symfony sortable collection form type

0.1.1 2017-02-14 14:15 UTC

This package is not auto-updated.

Last update: 2022-10-15 08:40:54 UTC


README

Build Status

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'
        ]
    ]);
    // ...
}