Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Oct 28, 2023
1 parent 06e9840 commit ec3764e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/phoenix_html/form.ex
Expand Up @@ -5,6 +5,9 @@ defmodule Phoenix.HTML.Form do
@moduledoc ~S"""
Define a `Phoenix.HTML.Form` struct and functions to interact with it.
For building actual forms in your Phoenix application, see
[the `Phoenix.Component.form/1` component](https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#form/1).
## Access behaviour
The `Phoenix.HTML.Form` struct implements the `Access` behaviour.
Expand All @@ -19,6 +22,11 @@ defmodule Phoenix.HTML.Form do
It is possible to "access" fields which do not exist in the source data
structure. A `Phoenix.HTML.FormField` struct will be dynamically created
with some attributes such as `name` and `id` populated.
## Custom implementations
There is a protocol named `Phoenix.HTML.FormData` which can be implemented
by any data structure that wants to be cast to the `Phoenix.HTML.Form` struct.
"""

alias Phoenix.HTML.Form
Expand Down
2 changes: 1 addition & 1 deletion lib/phoenix_html/form_data.ex
@@ -1,6 +1,6 @@
defprotocol Phoenix.HTML.FormData do
@moduledoc """
Converts a data structure into a [`Phoenix.HTML.Form`](`t:Phoenix.HTML.Form.t/0`) struct.
Converts a data structure into a `Phoenix.HTML.Form` struct.
## Ecto integration
Expand Down

0 comments on commit ec3764e

Please sign in to comment.