2017 © Pedro Peláez
 

symfony-bundle tree-bundle

This Symfony bundle integrates jsTree and Gedmo Nested Set directly to Sonata Admin

image

redcode/tree-bundle

This Symfony bundle integrates jsTree and Gedmo Nested Set directly to Sonata Admin

  • Wednesday, June 14, 2017
  • by maZahaca
  • Repository
  • 4 Watchers
  • 21 Stars
  • 14,808 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 4 Open issues
  • 2 Versions
  • 11 % Grown

The README.md

sonata-admin-tree-bundle

This bundle integrates jsTree and Gedmo Nested Set directly to Sonata Admin., (*1)

A tree builds itself in an asynchronous way. Hence, it's quite good for big trees., (*2)

Installation

Install requirements

SonataAdminBundle
- the SonataAdminBundle provides an installation article here:
http://symfony.com/doc/current/bundles/SonataAdminBundle/index.html, (*3)

StofDoctrineExtensionsBundle
- then you need to install StofDoctrineExtensionsBundle
https://symfony.com/doc/master/bundles/StofDoctrineExtensionsBundle/index.html, (*4)

Enable Tree Extension
- nested behaviour will implement the standard Nested-Set behaviour on your Entity
https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/tree.md, (*5)

Install TreeBundle

Install it via composer, (*6)

composer require redcode/tree-bundle

Register the bundle in your app kernel ./app/AppKernel.php, (*7)

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new RedCode\TreeBundle\RedCodeTreeBundle(),
        );
        ...
    }
}

Add the following lines to the routing file ./app/config/routing.yml, (*8)

redcode_tree:
    resource: "@RedCodeTreeBundle/Resources/config/routing.yml"
    prefix:   /admin

For the entity with enabled Gedmo Nested Set follow these steps:, (*9)

Extend Admin class from \RedCode\TreeBundle\Admin\AbstractTreeAdmin, (*10)

class SubjectAdmin extends AbstractTreeAdmin
{
...
}

Extend AdminController from \RedCode\TreeBundle\Controller\TreeAdminController, (*11)

class SubjectAdminController extends TreeAdminController
{
...
}

When registering the admin as a service, you need to provide a fourth argument - the name of the field that will be shown in the tree., (*12)

app.admin.subject:
    class: AppBundle\Admin\SubjectAdmin
    arguments: [~, AppBundle\Entity\Subject, AppBundle:SubjectAdmin, 'word']
    tags:
        - {name: sonata.admin, manager_type: orm, group: Search, label: Subject}

How it looks like

redcode/tree-bundle, (*13)

The Versions

14/06 2017

dev-master

9999999-dev https://github.com/redco/sonata-admin-tree-bundle

This Symfony bundle integrates jsTree and Gedmo Nested Set directly to Sonata Admin

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle ajax doctrine symfony asynchronous async tree set nested sonataproject

27/07 2016

0.1-alpha

0.1.0.0-alpha https://github.com/redco/sonata-admin-tree-bundle

This Symfony bundle integrates jsTree and Gedmo Nested Set directly to Sonata Admin

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle ajax doctrine symfony asynchronous async tree set nested sonataproject