modul-is / form
Simplified nette forms
v1.4.1
2026-04-17 05:18 UTC
Requires
- php: ^8.4
- kravcik/latte-font-awesome-icon: ^1
- nette/application: ^3.0 || ^4.0
- nette/forms: ^3.2.5
- nette/utils: ^4.0
Requires (Dev)
- dev-main
- v1.4.1
- v1.4
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.11
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-link-fix
- dev-whisperer-fix
- dev-vite
This package is auto-updated.
Last update: 2026-04-17 05:19:23 UTC
README
This library allows you to spend less time writing templates for Nette forms - it contains renderers for form, containers as well as all inputs
Getting started
Easiest way to create form is to create component which extends FormComponent class
class MyForm extends \ModulIS\Form\FormComponent
{
public function createComponentForm(): Form
{
$form = $this->getForm();
...
return $form;
}
}
Then you just add inputs to form, create MyForm component and all done!
Inputs
Form supports all of the default Nette inputs and adds new ones
addLink()- Button with link (eg. reset, go back buttons)addWhisperer()- select box with whisperer which filters optionsaddMultiWhisperer()- same as whisperer, more options can be selectedaddDuplicator()- container which can be duplicated many timesaddDependentSelect()- select box that can change options via ajax based on change of another input(s)addDependentMultiSelect()- same as DependentSelect, but more options can be selectedaddDate()- date input, can limit min and max date
Custom settings
Form
setTitle()- addcard-headerdiv with titlesetColor()- set color of formsetAjax()- form is submitted via ajaxaddBox()- all inputs added after this call will render in new cardsetFloatingLabel()- inputs will be rendered with floating labelssetRenderInline()- label and input are rendered each in separate rowsetButtonClass()- default CSS class for all form buttons (e.g.rounded rounded-4); can be overridden bysetClass()on individual buttonssetRenderManually()- set manual render, template with same name as form is used (eg. fileMyForm.php->myForm.latte)
Groups
Form is rendered in BS5 card - each card represents one group
Inputs are rendered in card-body div
Submitters, links and buttons in card-footer
Container
Container works as standard Nette Container and has these new features
setId()- add html id to outer div of containershowCard()- show container as BS5 cardsetTitle()- show title of container (only works when container is rendered as card)setColor()- set color of container (only works when container is rendered as card)
Inputs
Some inputs provide new features
setIcon()- add icon to input or button (Buttons, Links, Text inputs)setColor()- add color to input or button (Buttons, Links, Checkbox, Lists)setTemplate()- add custom latte template instead of basic render (All inputs)setPrepend()- adds prepend part to input group (Text inputs, Select boxes)setAppend()- adds append part to input group (Text inputs, Select boxes)setRenderInline()- render label and input each in separate row, overwritesrenderInlinesetting from Form (All non-button inputs)setFloatingLabel()- input will be rendered with floating labels (Text inputs, Select box)setAutorenderSkip()- skips rendering of input, eg. if input is rendered as part of another input with custom template (All inputs)setTooltip()- add icon with tooltip to input (Text inputs, Checkbox, Lists, Select boxes)setQuickCopy()- add button to copy input value to clipboard (Text inputs, TextArea)setWrapClass()- set class to outer div around label and input - overwrites basiccol-class (Text inputs, Checkbox, Lists, Select boxes)setLabelWrapClass()- set class to wrap div around label - overwrites basiccol-class (Text inputs, Checkbox, Lists, Select boxes)setInputWrapClass()- set class to wrap div around input - overwrites basiccol-class (Text inputs, Checkbox, Lists, Select boxes)
Duplicator example
$duplicator = $form->addDuplicator('duplicator', function(\ModulIS\Form\DuplicatorContainer $container)
{
$container->addText('text', 'Text input');
$container->addSubmit('del', 'Smazat');
}, 1);
$duplicator->addSubmit('add', 'Přidat');