TagBasedViewHelpers now have proper support for boolean attributes.
Before this change, it was very cumbersome to generate these with Fluid,
now it's implemented similar to popular JavaScript frameworks:
This can also be used in combination with variable casting:
<my:viewhelper async="{myString as boolean}" />
For compatibility reasons empty strings still lead to the attribute
being omitted from the tag. This might change in the future, however
we don't want to break templates now. ViewHelpers can define
an argument manually and implement the desired behavior in the
render method (this is how the ImageViewHelper in TYPO3 deals with
empty alt attributes).
TagBasedViewHelpers now have proper support for boolean attributes. Before this change, it was very cumbersome to generate these with Fluid, now it's implemented similar to popular JavaScript frameworks:
This can also be used in combination with variable casting:
For compatibility reasons empty strings still lead to the attribute being omitted from the tag. This might change in the future, however we don't want to break templates now. ViewHelpers can define an argument manually and implement the desired behavior in the render method (this is how the ImageViewHelper in TYPO3 deals with empty
alt
attributes).