nette/forms
Nette Forms is a PHP form-building library for creating secure, reusable web forms with built-in validation, CSRF protection, rendering helpers, and easy component composition. Integrates smoothly with Nette Framework but works standalone in any PHP app.
MAX_FILE_SIZE checks, SameSite CSRF protection). Critical for sprints where form development would otherwise bottleneck progress (e.g., e-commerce checkouts, data collection tools).addEmail(maxLength=255), addInteger() with overflow checks).MAX_FILE_SIZE enforcement).
Reduces audit risk by eliminating manual security patches for common form vulnerabilities.netteForms.js, ensuring:
data-nette-rules).SelectBox, checkbox list ordering).{formPrint}, {inputError} macros) and TypeScript support for modern frontend workflows.Container::getValues() now hydrates objects via PHP 8 constructor injection).Blueprint for generating form classes, DataClassGenerator for DTOs).Adopt when:
getValues(MyEnum::class)).addFloat(), addDateTime()).getValues(true) deprecated in v3.2.0).netteForms.js provides this out of the box).setHtmlAttribute(), DefaultFormRenderer).Blueprint for scaffolding).Look elsewhere when:
netteForms.js.netteForms is optimized for traditional request/response cycles.Illuminate\Support\Facades\Validator instead)."This package lets us ship form-heavy features 3x faster while reducing security risks. For example:
ROI:
"This is a drop-in replacement for custom form logic, giving us:
netteForms.js syncs with PHP rules automatically—no manual duplication.{formPrint} or scaffold classes with Blueprint.MAX_FILE_SIZE).name=val1,val2) and minimal DOM manipulation.Example Use Cases:
Migration Path:
netteForms rules.Blueprint to auto-generate form classes from existing DTOs.Trade-offs:
netteForms.js for client-side validation (but it’s lightweight and modular).Alternatives Considered:
Recommendation: Adopt for new projects or migrate high-priority forms (e.g., checkout, registration) first. Pair with Latte templates for rapid UI development."*
How can I help you explore Laravel packages today?