brandembassy/ui-components-nette-form

3.3 2022-05-23 09:49 UTC

README

Rendering of Nette Form in BrandEmbassy/UiComponets

Installation

composer require brandembassy/ui-components-nette-form

Usage

Register renerers in your services.neon file:

- BrandEmbassy\Components\NetteForm\NetteFormRenderer([
        BrandEmbassy\Components\NetteForm\FormField\TextInput\TextInputFieldRenderer(),
        BrandEmbassy\Components\NetteForm\FormField\TextArea\TextAreaFieldRenderer(),
        BrandEmbassy\Components\NetteForm\FormField\TextInput\LongTextInputFieldRenderer(),
        BrandEmbassy\Components\NetteForm\FormField\TextInput\TimeInputFieldRenderer(),
        BrandEmbassy\Components\NetteForm\FormField\Submit\SubmitFieldRenderer(),
        BrandEmbassy\Components\NetteForm\FormField\Hidden\HiddenInputFieldRenderer(),
        BrandEmbassy\Components\NetteForm\FormField\CheckBoxList\CheckboxListWithIconsFormFieldRenderer(),
        BrandEmbassy\Components\NetteForm\FormField\SelectBox\SelectBoxFieldRenderer(),
        BrandEmbassy\Components\NetteForm\FormField\RadioList\RadioListRenderer(),
    ])

And then simple use NetteFormRender as service to conver Nette Form object into UiComponent.

$compoent = $this->netteFormRenderer->render($form);

echo $compoent->render();