Download the PHP package sherlockode/sonata-sortable-bundle without Composer
On this page you can find all versions of the php package sherlockode/sonata-sortable-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sherlockode/sonata-sortable-bundle
More information about sherlockode/sonata-sortable-bundle
Files in sherlockode/sonata-sortable-bundle
Package sonata-sortable-bundle
Short Description Symfony Bundle for managing entities positions with Sonata admin
License MIT
Informations about the package sonata-sortable-bundle
Installation
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
Applications that don't use Symfony Flex
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
Sortable behavior in admin listing
Pre-requisites
You need to have a working Sonata admin and to have installed and configured gedmo/doctrine-extensions
(check stof/doctrine-extensions-bundle
for easy integration).
The recipe
First of all, add a position property in your entity
To change this position with Sonata, we need to add a new route in our admin:
Update the admin configuration to use our custom controller
Then, add default sort by position in the admin:
Add controls to allow the user to change the position of items:
All versions of sonata-sortable-bundle with dependencies
php Version ^8.1
sonata-project/admin-bundle Version ^4.0