Change Log
All notable changes to this project will be documented in this file. Updates should follow the Keep a CHANGELOG principles.
Unreleased
Changed
- BREAKING CHANGE: minimum PHP version raised from 7.1 to 8.4 (
"php": "^8.4"). The package already needed PHP 8.1+ through nette/forms 3.2. Stay on 2.x for older PHP versions. (#20, #24) - BREAKING CHANGE:
BootstrapRenderer,BootstrapVerticalRendererandBootstrapInlineRendererarefinal. Instead of subclassing a renderer to change$wrappers, change them on the instance ($renderer->wrappers['pair']['container'] = ...) or wrap the renderer in your ownNette\Forms\FormRenderer; see UPGRADE-3.0.md. The rendered HTML is unchanged. (#25) - All files declare
strict_types;render()has#[\Override],$novalidateis a promotedreadonlyproperty, and the control decoration shared by the three renderers lives in one internal trait. No change in output. (#25) Checkboxcontrols usegetContainerPrototype()instead of the deprecatedgetSeparatorPrototype()alias (same element, no change in output). (#20)- Autoloading uses PSR-4 (
Tomaj\Form\Renderer\→src/) instead of a classmap. Class names are unchanged. (#21) - The Composer dist archive contains only
src/,composer.jsonand the README, CHANGELOG and UPGRADE files; tests, fixtures and tool configs are no longer installed intovendor/. (#21)
Fixed
- Rendering no longer fails with a
TypeErrorwhen a button's class is stored as an array: set withaddClass()or as an array, and also when the same form is rendered a second time or part by part (render($form, 'begin'),'body', ...), because the first render adds thebtnclasses that way. The existing classes are checked forbtn; output for forms that rendered before is unchanged. (#20)
Added
- PHPUnit test suite that renders forms with all three renderers and compares the HTML with the output from before the fix. (#20)
- Tests for
novalidate: false, the form class added next to existing classes, class lists given as arrays of strings and$wrapperschanged on the instance; PHPUnit 13, 95 % statement coverage required in CI (100 % today) and mutation testing with Infection (minMsiandminCoveredMsi95). (#26) - GitHub Actions CI: tests on PHP 8.4–8.6 (plus prefer-lowest, nightly 8.7 allowed to fail), php-cs-fixer (PER-CS), PHPStan level max with strict rules, Rector, composer audit, statement coverage threshold with Coveralls upload. Release workflow (notes from the CHANGELOG, source archives with build provenance attestations), CodeQL and OpenSSF Scorecard. (#20, #22)
- Dependabot for Composer and GitHub Actions. (#20)
- Rector (PHP 8.4 set, dead code, code quality, type declarations, early return), PHP-CS-Fixer with
declare_strict_types, PHPStancheckMissingOverrideMethodAttributeandcheckUninitializedProperties; composer scriptsrector,rector-fix,coverage,infectionandcheckwith descriptions. (#23) - Documentation site at https://tomaj.github.io/nette-bootstrap-form/ (getting started, renderers with their rendered HTML, API reference with the
$wrappersof each renderer, upgrading to 3.0, changelog). Every PHP snippet in the docs, README and UPGRADE file is run by the test suite, and the links are checked in CI. (#27) CONTRIBUTING.md,CODE_OF_CONDUCT.md,SECURITY.md(supported versions, private vulnerability reporting),RELEASING.md,UPGRADE-3.0.md, issue and pull request templates. (#21)
2.1.1 - 2026-03-26
Fixed
- PHP 8.4:
render()declares?string $mode = nullexplicitly, so the "Implicitly marking parameter as nullable is deprecated" notice is gone. (#19)
2.1.0 - 2024-02-19
Changed
- BREAKING CHANGE: requires
nette/forms^3.2(was^3.0). Upgrade nette/forms together with this package. (#17) - BREAKING CHANGE: the
$wrappersproperty of all three renderers is typedpublic array $wrappers, as in nette/forms 3.2DefaultFormRenderer. A subclass that redeclares$wrappersmust declare it asarraytoo. (#17)
Fixed
- Using the renderers with nette/forms 3.2 no longer fails with "Type of
$wrappersmust be array". (#17)
2.0.1 - 2022-01-11
Fixed
- PHP 8.1: rendering a button without a CSS class no longer triggers the "Passing null to parameter of type string" deprecation in
strpos(). (#15)
2.0.0 - 2019-03-29
Changed
- BREAKING CHANGE: requires PHP 7.1+ and
nette/forms^3.0(was PHP 5.3.7+ and nette/forms~2.3). Stay on 1.x for nette/forms 2.x. (#14) - BREAKING CHANGE: native types on the renderers:
__construct(bool $novalidate = true)andrender(Form $form, string $mode = null): string. Subclasses that overriderender()must use the same signature. (#14) - The
licensefield in composer.json uses the SPDX identifierLGPL-2.0-or-later(wasLGPL).
1.3.0 - 2017-08-28
Added
- All three renderers accept a
$novalidateconstructor argument (new BootstrapRenderer(false)) to keep the browser's HTML5 validation. The default staystrue, so existing forms still getnovalidate. (#13)
1.2.0 - 2016-02-07
Added
BootstrapVerticalRenderer: the default Bootstrap layout with the label and the control on separate lines. (#9)- Buttons that already have a
btnclass keep their own classes instead of gettingbtn btn-primary/btn btn-default. (#1, #2)
Fixed
- The renderers add
form-horizontal/form-inlineto the form's classes instead of replacing them, so classes such asajaxare kept. (#3)
1.1.0 - 2015-07-07
Changed
BootstrapRenderer: the controls container and the hidden-fields container are plain<div>s instead of<div class="col-sm-12">, so the horizontal form no longer wraps its rows in an extra full-width column.
1.0.0 - 2015-07-06
Added
- Initial release: Bootstrap 3 renderers for Nette Forms 2.3 (PHP 5.3.7+).
BootstrapRendererrenders a horizontal form (form-horizontal, labels incol-sm-3, controls incol-sm-9),BootstrapInlineRendereran inline form (form-inline). Text inputs and selects getform-control, the first buttonbtn btn-primaryand the othersbtn btn-default, checkboxes and radio lists are wrapped for Bootstrap, errors are shown in analert alert-dangerbox, and the form getsnovalidate.