Skip to content

Commit efd3792

Browse files
committed
Additional cross-references for form helpers
1 parent 457f80f commit efd3792

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

docs/5.x/development/forms.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ While abbreviated, this “user profile” form contains all the patterns requir
358358
```
359359
:::
360360

361+
::: tip
362+
Note that we’re outputting errors from the `user` object (in `account.twig`) as well as any success or failure [flashes](#flashes) (in `_layouts/default.twig`).
363+
:::
364+
361365
The same principles apply to anything else you want to make editable in the front-end, so long as the user has the correct permissions. Take a look at the [public registration forms](kb:front-end-user-accounts) for some examples of validation on forms available to guests—and to learn about some nice abstractions that will help reduce repetition in your form markup!
362366

363367
#### Flashes
@@ -463,7 +467,7 @@ Inspecting the HTML output, you’ll see your template exactly as provided. Why
463467

464468
For JSON responses, redirection does’t make as much sense—so Craft will include the resolved `redirect` value for your client to navigate programmatically (say, via `window.location = resp.redirect`).
465469

466-
In addition to the `redirect` property, the response object will include a `message` key with the same text that would have been flashed (for a `text/html` response)—either a specific message from Craft, or one provided in the request via the [globally-supported `successMessage` param](../reference/controller-actions.md#global-params). Additional action-specific properties are also returned at the top level of the response object.
470+
In addition to the `redirect` property, the response object will include a `message` key with the same text that would have been flashed (for a `text/html` response)—either a specific message from Craft, or one provided in the request via the [globally-supported `successMessage` param](../reference/controller-actions.md#globally-supported-params). Additional action-specific properties are also returned at the top level of the response object.
467471

468472
### Failure
469473

docs/5.x/reference/controller-actions.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,16 @@ In each of the following examples, you’ll find a list of **Supported Params**
4343

4444
<a name="global-params" title="Parameters respected for all POST requests"></a>
4545

46-
::: tip
46+
### Globally-Supported Params
47+
4748
All POST actions honor a few additional parameters, except when using an `Accepts: application/json` header:
48-
- `redirect`: A [hashed](twig/filters.md#hash) URL or path that Craft will send the user to after a [successful request][success-after-post] (i.e. a user is registered or an entry is saved).
49-
- `successMessage`: Overrides the default flash notice for the action.
50-
- `failMessage`: Overrides the default flash error for the action.
49+
50+
- `redirect` — A [hashed](twig/filters.md#hash) URL or path that Craft will send the user to after a [successful request][success-after-post] (i.e. a user is registered or an entry is saved).
51+
- `successMessage` — Overrides the default flash notice for the action.
52+
- `failMessage` — Overrides the default flash error for the action.
53+
54+
::: tip
55+
You can use the [`redirectInput()`](twig/functions.md#redirectinput), [`successMessageInput()`](twig/functions.md#successmessageinput), and [`failMessageInput()`](twig/functions.md#failmessageinput) Twig functions to inject these params into a form.
5156
:::
5257

5358
### <badge vertical="baseline" type="verb">POST</badge> `entries/save-entry`

0 commit comments

Comments
 (0)