You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Form: standalone HTTP processing split into new StandaloneForm (BC break)
Form is now a detached base: it builds, validates and renders, but has
no access to submitted data (isAnchored() returns false, submission API
throws InvalidStateException pointing to StandaloneForm).
StandaloneForm extends Form and carries the standalone mechanics moved
from Form: $httpRequest, static initialize(), receiveHttpData() with
method/Sec-Fetch/tracker checks, the hidden '_form_' tracker and the
TrackerId constant. Form::initialize() is removed.
The base receiveHttpData() throws, making the isAnchored()/
receiveHttpData() pair contract loud in both directions. Descendants
providing their own source of submitted data must override both
(Nette\Application\UI\Form already does, it needs no change).
Internal neutralizing anonymous classes in Repeater::createTemplate()
and Blueprint::generateLatte() are simplified to plain `new Form`.
Copy file name to clipboardExpand all lines: CLAUDE.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,11 +63,15 @@ npm run lint:fix
63
63
### Core PHP Structure
64
64
65
65
**Class Hierarchy:**
66
-
-`Form` (extends `Container`) - Main entry point for form creation
66
+
-`Form` (extends `Container`) - Detached form: builds, validates and renders, but has no access to submitted data (`isAnchored()` returns `false`; submission API throws)
67
+
-`StandaloneForm` (extends `Form`) - Detects submission and processes its own HTTP request (`$httpRequest`, static `initialize()`, `receiveHttpData()`, hidden `_form_` tracker); use outside Nette Application
68
+
-`Nette\Application\UI\Form` (in nette/application, extends `Form`) - Anchored via presenter signals
67
69
-`Container` - Holds controls and nested containers
68
70
-`Control` (interface) - Contract for all form controls
69
71
-`BaseControl` (abstract) - Base implementation for controls
70
72
73
+
Subclasses providing their own source of submitted data must override `receiveHttpData()` together with `isAnchored()` (or extend `StandaloneForm`).
- Text inputs: `TextInput` (also email/password/number via `addEmail()`, `addPassword()`, `addInteger()`, etc.), `TextArea`
@@ -169,6 +173,13 @@ testException('description', function () {
169
173
-`addSubmit()` gained an `$onSubmit` parameter
170
174
- Removed deprecated functionality and deprecated some magic properties (BC break)
171
175
176
+
### Breaking Changes (v4.0)
177
+
178
+
- Submitted data are accessed layer by layer via `getSubmittedData()` & `getSubmittedValue()`; `getHttpData()` is deprecated
179
+
- Standalone HTTP processing split off `Form` into new `StandaloneForm`: `new Form` no longer autodetects submission (submission API throws `InvalidStateException`), `Form::initialize()` removed (use `StandaloneForm::initialize()`), `TrackerId`/`$httpRequest` moved to `StandaloneForm`, `Form::isAnchored()` returns `false`
180
+
181
+
(Design rationale for both changes is recorded as ADRs 0001 and 0002 in the machine-local private `docs/decisions/`, which exists only in the primary working clone.)
182
+
172
183
### New Latte features (v3.3)
173
184
174
185
-`{form scope name}` as an alternative to `{formContext name}`
0 commit comments