PHPackages                             jmf/rendering-preset-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/rendering-preset-bundle

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

jmf/rendering-preset-bundle
===========================

Rendering preset bundle for Symfony

2.0.2(2w ago)02842mitPHPPHP &gt;=8.3CI passing

Since Aug 19Pushed 2w agoCompare

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

READMEChangelogDependencies (45)Versions (12)Used By (2)

Rendering Preset Bundle
=======================

[](#rendering-preset-bundle)

Symfony bundle for defining and rendering named presets: reusable combinations of a data source, a Twig template, and a set of typed properties (label, alignment, etc.).

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

[](#installation)

```
composer require jmf/rendering-preset-bundle
```

Register the bundle if you are not using Symfony Flex:

```
// config/bundles.php
return [
    Jmf\RenderingPreset\JmfRenderingPresetBundle::class => ['all' => true],
];
```

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

[](#configuration)

### One file per preset (recommended)

[](#one-file-per-preset-recommended)

By default the bundle discovers every `*.yaml` file under `config/packages/jmf_rendering_preset/`. The filename (without `.yaml`) becomes the preset id. No explicit `paths` config is needed.

```
config/packages/
├── jmf_rendering_preset.yaml          # properties + optional twig_functions_prefix
└── jmf_rendering_preset/
    ├── boolean.yaml                   # preset id: boolean
    ├── date_time.yaml                 # preset id: date_time
    └── price.yaml                     # preset id: price

```

Each file contains only the preset body (no wrapper key):

```
# config/packages/jmf_rendering_preset/price.yaml
align:    'end'
label:    'Price'
source:   'price'
template: 'preset/price.html.twig'
```

### Main config file

[](#main-config-file)

```
# config/packages/jmf_rendering_preset.yaml
jmf_rendering_preset:

    # Optional: prefix for Twig functions (e.g. 'jmf_' → 'jmf_preset_render').
    #twig_functions_prefix: ''

    # Property definitions shared across all presets.
    properties:

        align:
            choices: ['center', 'left', 'right']
            default: 'left'
            required: false

        label:
            required: false
```

### Inline presets

[](#inline-presets)

Presets can also be defined inline under `presets:` instead of (or alongside) per-file presets. A preset id defined both ways is a configuration error.

```
jmf_rendering_preset:
    presets:
        price:
            align:    'end'
            label:    'Price'
            source:   'price'
            template: 'preset/price.html.twig'
```

### Custom paths

[](#custom-paths)

Override the discovery directory with `paths:`:

```
jmf_rendering_preset:
    paths:
        - '%kernel.project_dir%/config/presets'
```

Preset options
--------------

[](#preset-options)

KeyTypeDescription`parent`stringInherit from another preset id. Child values take precedence.`source`stringProperty path on the item to read the value from (e.g. `createdAt`). Overrides the caller's `$source` argument.`template`stringTwig template path used to render the value.``mixedAny property key defined under `properties:` (e.g. `align`, `label`).Twig usage
----------

[](#twig-usage)

```
{# Render the preset, returns an HTML string. #}
{{ preset_render('price', item) }}

{# Override the source field at call site. #}
{{ preset_render('date_time', item, 'updatedAt') }}

{# Get a RenderedPreset object to access content + properties separately. #}
{% set rendered = preset_get('price', item) %}
{{ rendered.content }}
{{ rendered.getPropertyValue('align') }}
```

Template example
----------------

[](#template-example)

```
{# templates/preset/price.html.twig #}
{% if _value is not null %}
    {{ _value | number_format(2) }} €
{% endif %}
```

Templates receive:

- `_value` : the resolved value read from the item via `source`
- `_item` : the original item (array or object)

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance97

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Total

11

Last Release

16d ago

Major Versions

1.1.x-dev → 2.0.0-rc12026-06-12

### 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 (28 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[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)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[sulu/sulu

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

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

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)

PHPackages © 2026

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