Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielkurecka/nette-form-blueprints
Manual rendering of Nette forms made easy.
https://github.com/danielkurecka/nette-form-blueprints
bootstrap3 bootstrap4 forms-generator latte nette tracy-panel
Last synced: about 1 month ago
JSON representation
Manual rendering of Nette forms made easy.
- Host: GitHub
- URL: https://github.com/danielkurecka/nette-form-blueprints
- Owner: danielkurecka
- License: mit
- Created: 2020-05-04T22:25:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-04T12:37:12.000Z (about 1 year ago)
- Last Synced: 2024-11-15T05:26:25.276Z (2 months ago)
- Topics: bootstrap3, bootstrap4, forms-generator, latte, nette, tracy-panel
- Language: PHP
- Homepage:
- Size: 182 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Form Blueprints generator for Nette Framework
This tool helps with manual rendering of Nette forms. It can generate Latte markup using various templates.## Installation
`composer require daku/nette-form-blueprints`## Usage
### Integration with Tracy debug panel
Register the extension in config.neon:
```neon
extensions:
formBlueprints: Daku\Nette\FormBlueprints\FormBlueprintsExtension
```From now on you will be able to see generated blueprints in debug panel for all forms that were attached to current presenter:
![Form Blueprints Tracy panel](https://danielkurecka.github.io/nette-form-blueprints/form-blueprints-panel.png)
#### Optional configuration
```neon
formBlueprints:
indentation: ' ' # change indentation to spaces# add custom templates
templates:
- CustomTemplate
```### Standalone usage
It is possible to generate a blueprint without integration to Tracy debug panel.Example:
```php
addText('foo');
$form->addSubmit('submit');// use the generator
$generator = new Daku\Nette\FormBlueprints\BlueprintsGenerator(new Daku\Nette\FormBlueprints\LatteFormatter(new Latte\Parser));
echo $generator->generate($form, new Daku\Nette\FormBlueprints\Templates\Bootstrap4Template);
```## Templates
Following templates are available:
- Table (mimics Nette's default form renderer)
- Line Breaks (simple template using line breaks only)
- Bootstrap 3
- Bootstrap 3 Horizontal
- Bootstrap 3 Inline
- Bootstrap 4
- Bootstrap 4 Horizontal
- Bootstrap 4 InlineAdditional templates can be used by implementing `Daku\Nette\FormBlueprints\Templates\Template`.
## Requirements
PHP >= 7.1\
Nette >= 2.4