Download the PHP package nivas/easyadmin-tree-list-bundle without Composer
On this page you can find all versions of the php package nivas/easyadmin-tree-list-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package easyadmin-tree-list-bundle
easyadmin-tree-list-bundle
EasyAdmin 3.x / Symfony 5.x compatible bundle which overrides default EasyAdmin index (list) templates and adds nested tree view on list for entities that use Gedmo Tree extension.
In order to achieve nested tree view, your entity must implement nested Gedmo tree on entity and following properties:
root_id
propertyparent_id
propertylft
(left) propertyrgt
(right) propertylvl
(level) property
Example of such entity: https://github.com/doctrine-extensions/DoctrineExtensions/blob/main/doc/tree.md
Notable mentions and some history
On many Symfony 4 projects, we used 2lenet/EasyAdminPlusBundle
's tree view feature. As we migrated projects to Symfony v5 / EasyAdmin v3 and Symfony v6 / EasyAdmin v4 - we lacked this simple tree view feature and decided to make tree view work again.
Hopefully bundle will work on PHP 8, Symfony 6 & EasyAdmin v4 as well (not yet tested).
History:
- WandiParis/EasyAdminPlusBundle original bundle from which everything started
- 2lenet/EasyAdminPlusBundle which forked
WandiParis/EasyAdminPlusBundle
and added tree view and made it work for EasyAdmin v1 -
uknight/EasyAdminPlusBundle which forked
2lenet/EasyAdminPlusBundle
and made it work for EasyAdmin v2To achieve tree functionality in templates, really old jQuery treetable Plugin 3.2.0 was used from Ludo van den Boom, just like in
2lenet/EasyAdminPlusBundle
bundle. Will check out how to replace it with something recent.
Installation
after installation your bundles.php
will contain new bundle:
Configuration
As mentioned previously, your entity must implement Gedmo Tree.
Your EasyAdmin CRUD controller should override:
configureResponseParameters
- used to enable tree config for twigcreateIndexQueryBuilder
- used to change sorting order needed to make a tree listconfigureActions
- used to remove batch actions in front of tree navigation arrow
Example of src/Controller/Admin/TermCrudController.php
Easyadmin v2 to v3 migration
In EasyAdmin v2 you could access value of entity property by typing eg. entity.id
. Not anymore. this was replaced by EasyAdmin's EntityDTO.
eg:
or eg: entity.root.id
becomes: entity.fields.getByProperty('root').value.id
Also, befure it was easy to access custom property defined in yaml (eg. tree: true
in example below):
In templates you would just use entity.tree
to access it.
Now this is done by overriding configureResponseParameters
of your admin crud class which extends AbstractCrudController
:
And usage in Twig template:
All versions of easyadmin-tree-list-bundle with dependencies
symfony/console Version *
symfony/dependency-injection Version *
symfony/config Version *
symfony/http-kernel Version *
easycorp/easyadmin-bundle Version ^3.0|^4.0