View Source Phoenix.UI.Helpers (Phoenix UI v0.1.9)
Provides helper functionality.
Link to this section Summary
Functions
Builds and normalizes list of classes.
Builds and normalizes list of classes.
Builds and normalizes list of classes.
Builds and normalizes list of classes.
Returns true if assigns field form data has error.
Returns true if attr data is a slot.
Translates an error message using gettext.
Translates the errors for a field from a keyword list of errors.
Link to this section Functions
@spec assign_class(Phoenix.LiveView.Socket.assigns(), [String.t()]) :: Phoenix.LiveView.Socket.assigns()
Builds and normalizes list of classes.
examples
Examples
iex> assign_class(assigns, [" class1", "class2 ", ...])
%{class: "class1 class2 ...", ..}
@spec assign_extend_class(Phoenix.LiveView.Socket.assigns(), [String.t()]) :: Phoenix.LiveView.Socket.assigns()
Builds and normalizes list of classes.
examples
Examples
iex> assign_extend_class(assigns, [" class1", "class2 ", ...])
%{class: "class1 class2 ...", ..}
@spec assign_rest(Phoenix.LiveView.Socket.assigns(), [atom()]) :: Phoenix.LiveView.Socket.assigns()
Builds and normalizes list of classes.
examples
Examples
iex> assign_rest(assigns, exclude)
%{...}
Builds and normalizes list of classes.
examples
Examples
iex> build_class([" class1", "class2 ", ...])
"class1 class2 ..."
@spec has_error?(Phoenix.LiveView.Socket.assigns()) :: boolean()
Returns true if assigns field form data has error.
examples
Examples
iex> has_error(assigns)
true
Returns true if attr data is a slot.
examples
Examples
iex> is_slot?(attrs)
true
Translates an error message using gettext.
Translates the errors for a field from a keyword list of errors.