PHPackages                             olajoscs/nestable-generator - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. olajoscs/nestable-generator

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

olajoscs/nestable-generator
===========================

A json generator and parser for the nestable structure editor

1.0.1(8y ago)112MITPHPPHP ~7.1CI failing

Since Sep 6Pushed 6y ago1 watchersCompare

[ Source](https://github.com/olajoscs/nestable-generator)[ Packagist](https://packagist.org/packages/olajoscs/nestable-generator)[ Docs](https://github.com/olajoscs/nestable)[ RSS](/packages/olajoscs-nestable-generator/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

nestable-generator
==================

[](#nestable-generator)

This is a small PHP package, to have a generator and parser for the [Nestable2](https://github.com/RamonSmit/Nestable2) javascript plugin.

Requirements
============

[](#requirements)

- php ~7.1

Usage
=====

[](#usage)

Instantiating the `NestableGenerator` class
-------------------------------------------

[](#instantiating-the-nestablegenerator-class)

- First of all, an array of elements are needed, which will be the base to generate the json. These elements must implement the `Element` interface. Basic functionality is implemented in the `AbstractElement` class, but it can be skipped if own implementation is needed.
- An object is needed which implements the `NestedElement` interface - this object is the source of the json generation. The `Element` objects are transformed to `NestedElement` objects. These `NestedElements` objects have a children property, to make possible the structure building.
- The `NestableGenerator` object needs only one constructor parameter: an `ElementCollection` object, which are built with the array of `Element` objects. This `ElementCollection` needs an array of the `Element` objects and an empty `NestableElement` object, which will be used as reference.

Generating json
---------------

[](#generating-json)

Once the `NestableGenerator` is created with the `ElementCollection`, just call ` generate()`. It returns the JSON which is needed to [Nestable ](https://github.com/RamonSmit/Nestable2) to generate the block.

Parsing JSON
------------

[](#parsing-json)

[Nestable ](https://github.com/RamonSmit/Nestable2) can send the created structure in json form. To parse this you need to instantiate the `NestableGenerator` class and call `parse($json)`, where the `$json` is the JSON string, generated by [Nestable ](https://github.com/RamonSmit/Nestable2). It returns the array of the `Element` objects.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~0 days

Total

3

Last Release

3218d ago

Major Versions

0.0.1 → 1.0.02017-09-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/47fabfd1980b2e2628bca1a93867e391932a1a5fe59ff3131dd3b59b44b031ad?d=identicon)[olajoscs](/maintainers/olajoscs)

---

Top Contributors

[![olajoscs](https://avatars.githubusercontent.com/u/6685631?v=4)](https://github.com/olajoscs "olajoscs (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/olajoscs-nestable-generator/health.svg)

```
[![Health](https://phpackages.com/badges/olajoscs-nestable-generator/health.svg)](https://phpackages.com/packages/olajoscs-nestable-generator)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19037.7M41](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9642.0k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

46143.1k6](/packages/jstewmc-rtf)[moonshine/layouts-field

Field for repeating groups of fields for MoonShine

107.9k](/packages/moonshine-layouts-field)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

112.9k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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