Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mskocik/forms
Nette representation of svelecte custom element
https://github.com/mskocik/forms
autocomplete datepicker nette nette-forms svelecte
Last synced: 26 days ago
JSON representation
Nette representation of svelecte custom element
- Host: GitHub
- URL: https://github.com/mskocik/forms
- Owner: mskocik
- Created: 2023-01-18T08:41:23.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-10T17:11:15.000Z (6 months ago)
- Last Synced: 2024-09-30T13:49:01.297Z (about 1 month ago)
- Topics: autocomplete, datepicker, nette, nette-forms, svelecte
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Form custom elements
Provide backend implementation of some svelte custom elements ([svelecte](https://github.com/mskocik/svelecte) and [svelty-picker](https://github.com/mskocik/svelty-picker))
## Install
```bash
composer require mskocik/forms
```## Register extension
```neon
extensions:
ext.forms: Mskocik\Forms\Bridges\NetteDI\FormsExtension
```If you are using [nette/forms](https://github.com/nette/forms) standalone, call control registration manually:
```php
\Mskocik\Forms\Bridges\NetteDI\FormsExtension::init()
```## Extend nette form for IDE autocomplete
Extend `Nette\Application\UI\Form` (or `Nette\Forms\Form` if using standalone forms) and also `Nette\Forms\Container` with extended PHPDoc block:
```php
addSvelecteSelect('select', 'My Select', [/** item array */])
->setFetch($presenter->link('Api:fetch', ['id' => '[query]']))
->setRequired();
// ...
```