Per-element cross-check between phx-value-* attributes and the
declared params on the corresponding action.
Composes with ValidateEvents: that transformer ensures every literal
event name resolves to some declared action. This one ensures that on
any element with phx-click="name" (or phx-submit/phx-change/etc.),
the set of phx-value-foo attribute keys exactly matches the declared
args: list for action :name.
Rules:
- Each
phx-value-fookey on the element must appear in the action's declared args. Unknown keys ⇒ DslError (typo detection). - Each declared arg must appear as a
phx-value-fookey. Missing args ⇒ DslError. - Dynamic event names (
phx-click={@x}) are skipped — the binding to a specific action isn't resolvable at compile time. - Dynamic
phx-value-foo={@x}values are fine; only the key is checked, not the value's runtime type. - Event names that don't match any declared action are not reported
here —
ValidateEventsalready raises in that case. We just skip them to avoid double-reporting.
Summary
Functions
Callback implementation for Spark.Dsl.Transformer.after?/1.
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.
Callback implementation for Spark.Dsl.Transformer.transform/1.
Functions
Callback implementation for Spark.Dsl.Transformer.after?/1.
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.
Callback implementation for Spark.Dsl.Transformer.transform/1.