adt / base-form
Nette abstract form class with snippet support
Installs: 14 084
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 18
Forks: 0
Open Issues: 0
Requires
- php: >=7.4
- adt/doctrine-forms: ^1.0
- nette/forms: ^3.0
This package is auto-updated.
Last update: 2022-06-22 13:33:45 UTC
README
- Bootstrap 4 renderer
- all forms are ajax by default - you can turn this off by setting
$this->isAjax = false
- if you want use toggles in a form, just add
$form->addGroup('anyNameYouWant')
before the element(s) you want to toggle and then do$form['showElement']->addCondition($form::FILLED)->toggle('anyNameYouWant')
. After the element(s), just use$form->addGroup()
. MethodaddGroup
just wrap elements to div withid
attribute set toanyNameYouWant
, it won't render any group caption. If you want to render a caption, do it manually in latte and then call{include renderGroup form => $form, group => 'nameOfYourGroup'}
- if you render a form manually, you can use macro
formPair
for rendering both label and input including all the related stuff (wrapping div, error div, description div etc.) - if you render a form manually, you can use
{include errors}
for rendering errors - you can also render an entire container by
{include renderContainer container => $form['container']}
- empty labels are not rendered
- submits are rendered as buttons (due to higher flexibility)