PHPackages                             survos/tree-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. survos/tree-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

survos/tree-bundle
==================

incorporate jstree, using twig and stimulus and api-platform

2.0.182(1mo ago)02.4k↓33.3%MITJavaScriptPHP ^8.4CI failing

Since Sep 19Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/survos/tree-bundle)[ Packagist](https://packagist.org/packages/survos/tree-bundle)[ GitHub Sponsors](https://github.com/kbond)[ RSS](/packages/survos-tree-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (43)Versions (857)Used By (0)

Survos Tree Bundle
==================

[](#survos-tree-bundle)

Tree UI + API editing for Symfony UX Twig Components.

This bundle provides:

- `apiTreeBrowser` / `api_tree` Twig components (jsTree-backed)
- `@survos/tree-bundle/api_tree` Stimulus controller
- `{% tree %}` Twig tag for recursive rendering

Install
-------

[](#install)

```
composer require survos/tree-bundle
```

Required JS modules (important)
-------------------------------

[](#required-js-modules-important)

`apiTreeBrowser` can render embedded Twig blocks in the browser. For this to work reliably, your importmap must include:

- `@tacman1123/twig-browser`
- `@tacman1123/twig-browser/adapters/symfony`
- `@tacman1123/twig-browser/src/compat/compileTwigBlocks.js`
- `@survos/js-twig/generated/fos_routes.js` (for `path()` in client-side twig)

If these are missing or incompatible, the controller now fails fast with a clear error instead of silently falling back.

Minimal Example
---------------

[](#minimal-example)

```

        {{ node.name ?? node.title ?? node.code ?? node.id }}

        {% set item = record ?? node %}
        {{ item.name ?? item.title ?? item.id }}

```

Variables available inside client-side Twig blocks
--------------------------------------------------

[](#variables-available-inside-client-side-twig-blocks)

Inside `nodeLabel` / `api_tree_content`, these render vars are available:

- `node` - selected jsTree node payload
- `record` - full fetched API record for selected node
- `item` - alias of `record ?? node`
- `hydra` - alias of `item`
- `globals` - values passed from component `:globals="..."`

If you pass tenant info via globals, reference `globals.tenantId` (not `tenantId` directly).

Example:

```
{% set params = { tenantId: globals.tenantId, instanceId: item.id } %}
Browse
```

Styling hooks (Tabler/Bootstrap/custom)
---------------------------------------

[](#styling-hooks-tablerbootstrapcustom)

Use component class options:

- `browserClass`
- `treePaneClass`
- `contentPaneClass`
- `style="plain"` to avoid the built-in bootstrap grid wrapper

Wrapper includes `api-tree-browser--themeable` for easy theming.

Example:

```

```

Toolbar buttons
---------------

[](#toolbar-buttons)

Built-in toolbar includes search and clear.

Optional slideshow button appears when you pass:

```
:globals="{ slideshowUrl: '/my/slideshow/url' }"
```

API controller defaults
-----------------------

[](#api-controller-defaults)

Bundle config now supports separate controllers:

```
survos_tree:
  tree_stimulus_controller: '@survos/tree-bundle/tree'
  api_tree_stimulus_controller: '@survos/tree-bundle/api_tree'
```

Legacy `stimulus_controller` is deprecated.

Performance behavior
--------------------

[](#performance-behavior)

- Tree list loads from collection endpoint once.
- Full detail `GET {id}` fetch happens on explicit node selection.
- Label rendering uses already-loaded collection data.

Troubleshooting
---------------

[](#troubleshooting)

- Error: `Twig function path is not configured`

    - Ensure `@survos/js-twig/generated/fos_routes.js` is mapped in importmap.
    - Ensure `var/js_twig_bundle/generated/fos_routes.js` exists (cache warmer).
    - Ensure `@tacman1123/twig-browser`, `@tacman1123/twig-browser/adapters/symfony`, and `@tacman1123/twig-browser/src/compat/compileTwigBlocks.js` are mapped.
- Detail block cannot see `tenantId`

    - Use `globals.tenantId` unless you explicitly flatten into top-level context.

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance90

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

856

Last Release

50d ago

Major Versions

1.6.18 → 2.0.152025-09-28

PHP version history (4 changes)v1.2.2PHP ^8.1

1.5.231PHP ^8.2

1.5.396PHP ^8.3

2.0.15PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/21b39551f92ed4143772c622f9e571589c5a72c96ab3c53fe67489ce0d83e806?d=identicon)[tacman1123](/maintainers/tacman1123)

---

Top Contributors

[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (43 commits)")

---

Tags

symfony-uxhierarchical

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/survos-tree-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/survos-tree-bundle/health.svg)](https://phpackages.com/packages/survos-tree-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
