PhxComponentHelpers.set_component_attributes
You're seeing just the function
set_component_attributes
, go back to PhxComponentHelpers module for more information.
Extends assigns with html_* attributes that can be interpolated within your component markup.
Parameters
assigns
- your component assignsattributes
- a list of attributes (atoms) that will be fetched from assigns
Options
:init
- a list of attributes that will be initialized if absent from assigns:required
- raises if required attributes are absent from assigns:json
- when true, will JSON encode the assign value
Example
assigns
|> set_component_attributes([:id, :name, :label], required: [:id, :name])
|> set_component_attributes([:value], json: true)
assigns
now contains @html_id
, @html_name
, @html_label
and @html_value
.