PHPackages                             jmf/grid-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. [Framework](/categories/framework)
4. /
5. jmf/grid-bundle

ActiveSymfony-bundle[Framework](/categories/framework)

jmf/grid-bundle
===============

Grid bundle for Symfony

8.0.0(3w ago)0411mitPHPPHP &gt;=8.3CI passing

Since Apr 4Pushed 2w ago1 watchersCompare

[ Source](https://github.com/jmfeurprier/grid-bundle)[ Packagist](https://packagist.org/packages/jmf/grid-bundle)[ RSS](/packages/jmf-grid-bundle/feed)WikiDiscussions 8.0 Synced today

READMEChangelogDependencies (38)Versions (39)Used By (0)

jmf/grid-bundle
===============

[](#jmfgrid-bundle)

A Symfony bundle for rendering HTML table grids from declarative YAML configuration and runtime data.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- Symfony 7 or 8

Installation
------------

[](#installation)

```
composer require jmf/grid-bundle
```

Register the bundle in `config/bundles.php`:

```
return [
    // ...
    Jmf\Grid\JmfGridBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

Create `config/packages/jmf_grid.yaml`:

```
jmf_grid:
    # template_path: '@JmfGrid/grid.html.twig'   # default
    # twig_functions_prefix: ''                  # default (e.g. set to 'jmf_' → jmf_grid())

    grids:
        articles:
            grid:
                variables:
                    entityType: 'article'
            rows:
                link: '{{ path("article.read", {"id": _item.id}) }}'
                variables:
                    entityId: '{{ _item.id }}'
            columns:
                -
                    label:  'Title'
                    source: 'title'
                -
                    preset: 'date'
                    source: 'publishedAt'
                -
                    preset: 'button_show'
```

### Splitting grids configuration into separate files

[](#splitting-grids-configuration-into-separate-files)

Large projects can split grid definitions into one file per grid. Place YAML files under the configured paths and name each file after the grid id:

```
jmf_grid:
    paths:
        - '%kernel.project_dir%/config/packages/jmf_grid'
```

File at `config/packages/jmf_grid/articles.yaml` then becomes the `articles` grid configuration.

### Grid options

[](#grid-options)

KeyDescription`grid.variables`Key-value pairs available in all column/footer templates`grid.arguments`Required runtime arguments (passed when calling `grid()`)`rows.link`Twig template for the row link URL. `_item` refers to the current data item`rows.variables`Key-value Twig templates evaluated per row. `_item` is available`columns`List of column definitions (see below)`footer`List of footer row definitions, each a list of footer cell definitions### Column options

[](#column-options)

KeyDescription`source`Property path on the data item (uses Symfony PropertyAccess)`label`Column header label`align`Cell alignment (`left`, `center`, `right`, `start`, `end`)`template`Twig template for cell content. `_value` holds the extracted value`preset`Preset ID from `jmf/rendering-preset-bundle` (provides defaults for the above)Column-level settings override preset values when both are defined.

### Footer cell options

[](#footer-cell-options)

KeyDescription`align`Cell alignment`template`Twig template for cell content`value`Static string value`merge`Number of columns to span`preset`Preset IDUsage
-----

[](#usage)

In a Twig template:

```
{{ grid('articles', articles) }}

{# With runtime arguments: #}
{{ grid('articles', articles, {someArgument: 'value'}) }}

{# With extra template parameters: #}
{{ grid('articles', articles, {}, {class: 'table-striped'}) }}
```

The `grid()` function signature:

```
grid(gridId, items, arguments = [], parameters = [])

```

- `gridId` : key from your `jmf_grid.grids` config
- `items` : array of objects or associative arrays
- `arguments` : runtime values for argument-gated grids
- `parameters` : extra variables passed to the grid template

Presets
-------

[](#presets)

Columns and footer cells support a `preset` key that references a named preset from [`jmf/rendering-preset-bundle`](https://github.com/jmfeurprier/rendering-preset-bundle). Presets define reusable defaults for `align`, `label`, `source`, and `template`. Column-level settings override preset values.

Example preset configuration (`config/packages/jmf_rendering_preset.yaml`):

```
jmf_rendering_preset:
    properties:
        align:
            choices: [center, left, right, start, end]
            default: left
            required: false
        label:
            required: false

    presets:
        date:
            align:    'center'
            template: '{% if (_value is not null) %}{{ _value.format("Y-m-d") }}{% endif %}'

        button_show:
            align:    'end'
            template: 'Show'

        button_edit:
            align:    'end'
            template: 'Edit'
```

Architecture
------------

[](#architecture)

```
src/
├── Configuration/    # YAML loader: assembles grid configs from paths + inline keys (used by the bundle)
├── Compilation/      # Compilers: transform raw config arrays into Definition objects (once, at container build)
│   └── PresetApplier.php
├── Definition/       # Value objects: compiled grid/column/row/footer definitions and their collection
├── Generation/       # Generators: produce Model objects from Definitions and runtime data
├── Model/            # Runtime model: Grid, Column, Row, RowCell, Footer, … (returned by generators)
├── Twig/             # GridExtension: exposes the grid() Twig function
└── JmfGridBundle.php

```

The flow at runtime:

1. **Configuration** → raw `array` assembled from YAML at container build
2. **Compilation** → `GridDefinitionCollection` (value objects) built once by `GridDefinitionCollectionCompiler`, held as a DI singleton via `GridGeneratorFactory`
3. **Generation** → `GridGenerator::generate()` walks the definitions and runtime `$items`, producing a `Grid` model
4. **Twig** → `GridExtension` calls `GridGenerator` and renders the result through the configured template

License
-------

[](#license)

MIT

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance96

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity72

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

Recently: every ~20 days

Total

39

Last Release

21d ago

Major Versions

2.0.3 → 4.0.62025-03-30

4.0.x-dev → 5.0.02025-08-25

5.2.x-dev → 6.0.02026-03-19

6.0.x-dev → 7.0.02026-03-26

7.0.x-dev → 8.0.02026-06-13

PHP version history (3 changes)1.0.0PHP &gt;=7.4

2.0.0PHP &gt;=8.1

3.0.0-rc1PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b08b8105ec8bc88d1c911e10dbf156814769650a67960e2f3d71ed6d2417f0d?d=identicon)[jmfeurprier](/maintainers/jmfeurprier)

---

Top Contributors

[![jmfeurprier](https://avatars.githubusercontent.com/u/8434690?v=4)](https://github.com/jmfeurprier "jmfeurprier (76 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jmf-grid-bundle/health.svg)

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

###  Alternatives

[sulu/sulu

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

1.3k1.4M203](/packages/sulu-sulu)[sylius/sylius

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

8.5k5.9M738](/packages/sylius-sylius)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)

PHPackages © 2026

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