Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

sergeyfedotov/symfony-sortable-collection-type-bundle

Repository files navigation

FsvSortableCollectionTypeBundle

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages