Download the PHP package runroom-packages/sortable-behavior-bundle without Composer
On this page you can find all versions of the php package runroom-packages/sortable-behavior-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download runroom-packages/sortable-behavior-bundle
More information about runroom-packages/sortable-behavior-bundle
Files in runroom-packages/sortable-behavior-bundle
Package sortable-behavior-bundle
Short Description Provides a way to sort your admin listing
License MIT
Homepage https://github.com/runroom/RunroomSortableBehaviorBundle
Informations about the package sortable-behavior-bundle
RunroomSortableBehaviorBundle
This bundle gives the ability to define sortable entities and to be able to sort the using Sonata Backoffice. It is inspired on: pixSortableBehaviorBundle.
Installation
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles in config/bundles.php
file of your project:
Usage
This bundle checks if you are using Gedmo Sortable to handle the sort order of your entities, if not, it will use the default ORM implementation, where you will need to add entities on the configuration of the bundle manually. If you are using Gedmo, and don't want to change the default field name position
, you don't need to configure anything for the bundle.
We provide a trait, so you can easily add the position field with the Gedmo configuration on each entity you want to be able to sort:
And then, on your admin class, you can add the SortableAdminTrait
trait to be able to sort the entities on the list view:
And that's all, you should now see the sort buttons on the list view of your admin class.
Configuration
Use a draggable list instead of up/down buttons
In order to use a draggable list instead of up/down buttons, change the template in the move
action to @RunroomSortableBehavior/sort_drag_drop.html.twig
.
Contribute
The sources of this package are contained in the Runroom monorepo. We welcome contributions for this package on runroom/runroom-packages.
License
This bundle is under the MIT license.
All versions of sortable-behavior-bundle with dependencies
doctrine/doctrine-bundle Version ^2.8
doctrine/orm Version ^2.14
symfony/config Version ^5.4 || ^6.2
symfony/dependency-injection Version ^5.4 || ^6.2
symfony/http-foundation Version ^5.4 || ^6.2
symfony/http-kernel Version ^5.4 || ^6.2
symfony/property-access Version ^5.4 || ^6.2
symfony/translation Version ^5.4 || ^6.2
twig/twig Version ^3.0