PHPackages                             pitch/liform - 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. pitch/liform

ActiveSymfony-bundle

pitch/liform
============

Transform Symfony Forms into Json Schema

v1.1.2(4y ago)3241[1 issues](https://github.com/ph-fritsche/liform/issues)MITPHPPHP &gt;=7.4

Since May 11Pushed 4y agoCompare

[ Source](https://github.com/ph-fritsche/liform)[ Packagist](https://packagist.org/packages/pitch/liform)[ RSS](/packages/pitch-liform/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (5)Dependencies (13)Versions (6)Used By (0)

[![codecov](https://camo.githubusercontent.com/74c50bab00b4575427a0b4a64bc340e7520e2502e2c63ec11d071daf7d9f2baf/68747470733a2f2f636f6465636f762e696f2f67682f70682d66726974736368652f6c69666f726d2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/ph-fritsche/liform)

[![Liform](https://camo.githubusercontent.com/a7856df6c11487dbc3f1f89dca9984e30ceb4c15bc5d5d9558a84653c59aa0a4/68747470733a2f2f70682d66726974736368652e6769746875622e696f2f6c69666f726d2f6173736574732f6c69666f726d2e706e67)](https://camo.githubusercontent.com/a7856df6c11487dbc3f1f89dca9984e30ceb4c15bc5d5d9558a84653c59aa0a4/68747470733a2f2f70682d66726974736368652e6769746875622e696f2f6c69666f726d2f6173736574732f6c69666f726d2e706e67)
===============================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#)

Library for transforming [Symfony Form Views](https://symfony.com/doc/current/components/form.html) into JSON.

It is developed to be used with [liform-react-final](https://www.npmjs.com/package/liform-react-final), but can be used with any form rendering supporting [JSON schema](http://json-schema.org/).

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

[](#installation)

Install per [Composer](https://getcomposer.org/) from [Packagist](https://packagist.org/packages/pitch/liform).

```
composer require pitch/liform

```

If you execute this inside a Symfony application with [Symfony Flex](https://symfony.com/doc/current/setup/flex.html), `LiformInterface` will be available per [Dependency Injection](https://symfony.com/doc/current/service_container.html#injecting-services-config-into-a-service) right away.

Basic usage
-----------

[](#basic-usage)

```
$form = \Symfony\Component\Form\Forms::createFormFactory()->create();
$form->add('foo', \Symfony\Component\Form\Extension\Core\Type\TextType::class);
$form->add('bar', \Symfony\Component\Form\Extension\Core\Type\NumberType::class);

/* ... handle the request ... */

$resolver = new \Pitch\Liform\Resolver();
$resolver->setTransformer('text', new \Pitch\Liform\Transformer\StringTransformer());
$resolver->setTransformer('number', new \Pitch\Liform\Transformer\NumberTransformer());
/* ... */

$liform = new \Pitch\Liform\Liform($resolver);
$liform->addExtension(new \Pitch\Liform\Extension\ValueExtension());
$liform->addExtension(new \Pitch\Liform\Extension\LabelExtension());
/* ... */

return $liform->transform($form->createView());
```

### Inside a Symfony application

[](#inside-a-symfony-application)

```
namespace App\Controller;

/* use statements */

class MyFormController extends Symfony\Bundle\FrameworkBundle\Controller\AbstractController
{
   protected LiformInterface $liform;

   /* Let the service container inject the service */
   public function __construct(LiformInterface $liform)
   {
      $this->liform = $liform;
   }

   public function __invoke(Request $request)
   {
      $form = $this->createForm(MyFormType::class);
      $form->handleRequest($request);
      if ($form->isSubmitted() && $form->isValid()) {
         /* ... do something ... */
      } else {
         return new Response($this->render('my_form.html.twig', [
            'liform' => $this->liform->transform($form->createView()),
         ]), $form->isSubmitted() ? 400 : 200);
      }
   }
}
```

### The result

[](#the-result)

The `TransformResult` is an object that when passed through `json_encode()` will produce something like:

```
{
   "schema": {
      "title": "form",
      "type": "object",
      "properties": {
         "foo": {
            "title": "foo",
            "type": "string"
         },
         "bar": {
            "title": "bar",
            "type": "number",
         }
      },
      "required": [
         "foo",
         "bar"
      ]
   },
   "meta": {
      "errors": {
         "foo": ["This is required."]
      }
   },
   "values": {
      "bar": 42
   }
}
```

Acknowledgements
----------------

[](#acknowledgements)

This library is based on [Limenius/Liform](https://github.com/Limenius/Liform). Its technique for transforming forms using resolvers and reducers is inspired by [Symfony Console Form](https://github.com/matthiasnoback/symfony-console-form).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.6% 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 ~11 days

Total

4

Last Release

1798d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/14faf0e942f2e3361ad07e017bf356d02bb7b76ab47d66a0d52faf4c03e6faec?d=identicon)[ph.fritsche](/maintainers/ph.fritsche)

---

Top Contributors

[![nacmartin](https://avatars.githubusercontent.com/u/154258?v=4)](https://github.com/nacmartin "nacmartin (144 commits)")[![ph-fritsche](https://avatars.githubusercontent.com/u/39068198?v=4)](https://github.com/ph-fritsche "ph-fritsche (59 commits)")[![sjopet](https://avatars.githubusercontent.com/u/881246?v=4)](https://github.com/sjopet "sjopet (6 commits)")[![Invis1ble](https://avatars.githubusercontent.com/u/1710944?v=4)](https://github.com/Invis1ble "Invis1ble (2 commits)")[![VictoriaQ](https://avatars.githubusercontent.com/u/389302?v=4)](https://github.com/VictoriaQ "VictoriaQ (2 commits)")[![nico-incubiq](https://avatars.githubusercontent.com/u/11662249?v=4)](https://github.com/nico-incubiq "nico-incubiq (2 commits)")[![vutran](https://avatars.githubusercontent.com/u/1088312?v=4)](https://github.com/vutran "vutran (1 commits)")[![demroos](https://avatars.githubusercontent.com/u/6542004?v=4)](https://github.com/demroos "demroos (1 commits)")[![xabbuh](https://avatars.githubusercontent.com/u/1957048?v=4)](https://github.com/xabbuh "xabbuh (1 commits)")[![grimpows](https://avatars.githubusercontent.com/u/18550672?v=4)](https://github.com/grimpows "grimpows (1 commits)")[![kermorgant](https://avatars.githubusercontent.com/u/10561580?v=4)](https://github.com/kermorgant "kermorgant (1 commits)")[![mablae](https://avatars.githubusercontent.com/u/389360?v=4)](https://github.com/mablae "mablae (1 commits)")[![phpwutz](https://avatars.githubusercontent.com/u/133333?v=4)](https://github.com/phpwutz "phpwutz (1 commits)")[![ThePolkaDotRook](https://avatars.githubusercontent.com/u/37351634?v=4)](https://github.com/ThePolkaDotRook "ThePolkaDotRook (1 commits)")

---

Tags

formsjson-schemasymfony-bundlesymfony-form

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/pitch-liform/health.svg)

```
[![Health](https://phpackages.com/badges/pitch-liform/health.svg)](https://phpackages.com/packages/pitch-liform)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[a2lix/auto-form-bundle

Automate form building

873.8M11](/packages/a2lix-auto-form-bundle)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[ehyiah/ux-quill

Symfony UX Bundle to use Quill JS wysiwyg text editor with full and easy customisation

5868.1k2](/packages/ehyiah-ux-quill)[pixelopen/cloudflare-turnstile-bundle

A simple package to help integrate Cloudflare Turnstile on Symfony.

31205.8k3](/packages/pixelopen-cloudflare-turnstile-bundle)

PHPackages © 2026

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