marko / forms
Server-rendered form round trips for Marko Framework - redirect back with flashed validation errors and old input, plus csrf_field/old/errors template helpers
0.13.0
2026-11-01 12:48 UTC
Requires
- php: ^8.5
- marko/config: 0.13.0
- marko/core: 0.13.0
- marko/routing: 0.13.0
- marko/security: 0.13.0
- marko/session: 0.13.0
- marko/validation: 0.13.0
- marko/view: 0.13.0
Requires (Dev)
- marko/testing: 0.13.0
- marko/view-latte: 0.13.0
- marko/view-twig: 0.13.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-03 19:19:06 UTC
README
Server-rendered form round trips for Marko --- redirect back with flashed validation errors and old input, plus csrf_field(), old() and errors() template helpers for Latte and Twig.
Installation
composer require marko/forms
Quick Example
use Marko\Routing\Attributes\Post; #[Post('/register')] public function store(Request $request): Response { // On failure: 303 back to the form with the errors and old input flashed $this->validator->validateOrFail($request->post(), ['email' => ['required', 'email']]); return Response::redirect('/welcome', 303); }
<form method="post"> {csrf_field()} <input name="email" value={old('email')}> {if $errors->has('email')}<p>{$errors->first('email')}</p>{/if} </form>
Documentation
Full usage, API reference, and examples: marko/forms