#72235Checked attribute not workling in Fluids' CheckboxViewHelper for non property values
Description
In case one wants to use the “checked” attribute of fluids CheckboxViewHelper via a condition or just by setting it to “true” it does not work.
Example:
<f:form name="data[mykey]" value="1" checked="{data.key} == 1"></f:form>This is caused by a wrong check in the CheckboxViewHelper on line 112-114 as there’s always a string passed to the viewhelper
if ($checked === true) {
$this->tag->addAttribute(‘checked’, ‘checked’);
}
To solve this problem a typecast on “$checked” needs to be made.
if ((boolean)$checked === true) {
$this->tag->addAttribute(‘checked’, ‘checked’);
}