Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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();
// ...
```