You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[FEATURE] Introduce argument definitions for templates and partials
The new `<f:argument>` ViewHelper allows to define an API
for templates, partials and layouts that will be validated when
the template/partial/layout is rendered. For each argument,
a type can be defined. By default, arguments are defined as
non-optional, but they can be defined as optional by using
`optional="{false}"`. Optional arguments can have default
values, which are defined with `default="my default value"`.
To avoid unnecessary complexity, the ViewHelper ensures that
no dynamic content (like variables) can be used in an argument
definition. Also, `<f:argument>` can't be nested into other
ViewHelpers.
Template argument definitions are processed and verified
by the new `StrictArgumentProcessor`, which properly
ensures argument types by casting scalar values and checking
the types more thoroughly than the `LenientArgumentProcessor`.
This means that currently template arguments are validated
in a different way than ViewHelper arguments, however
this will be resolved with Fluid v5.
Currently, there is no way to prohibit additional arguments
that are not defined with the `<f:argument>` ViewHelper,
however this might still be added in the future.
0 commit comments