octava / symfony-json-schema-form
Clone of limenius/liform. Symfony json schema form is a library for serializing Symfony Forms into JSON schema.
Installs: 29 751
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >7.4.16
- symfony/form: ^5.4|^6.4
- symfony/http-kernel: ^5.4|^6.4
- symfony/serializer: ^5.0|^6.4
- symfony/translation: ^5.0|^6.4
- symfony/translation-contracts: ^2.5|^3.4
- symfony/validator: ^5.4|^6.4
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^0.7.2
- escapestudios/symfony2-coding-standard: ^3.12
- phpro/grumphp: ^1.12
- phpunit/phpunit: ^9.5
README
It generates a JSON schema representation, that serves as documentation and can be used to validate your data and, if you want, to generate forms using a generator.
It can be used along with liform-react or json-editor, or any other form generator based on json-schema.
Installation
- Download the Bundle
composer require octava/symfony-json-schema-form
- Enable the Bundle
Usage
Serializing a form into JSON Schema:
$form = $this->createForm(CarType::class, $car, ['csrf_protection' => false]); $schema = json_encode($this->get('sjsfom')->transform($form));