class CheckboxViewHelper extends AbstractFormFieldViewHelper (View source)

View Helper which creates a simple checkbox ().

= Examples =

<output>
<input type="checkbox" name="myCheckBox" value="someValue" />
</output>

<code title="Preselect">
<neos.media:form.checkbox name="myCheckBox" value="someValue" checked="{object.value} == 5" />
(depending on $object)


<output>
<input type="checkbox" name="user[interests][]" value="Neos" checked="checked" />
(depending on property "interests")
</output>

Properties

protected string $tagName

Methods

void
initializeArguments()

Initialize the arguments.

string
render()

Renders the checkbox.

string
getNameWithoutPrefix()

Get the name of this form element, without prefix.

Details

void initializeArguments()

Initialize the arguments.

Return Value

void

Exceptions

Exception

string render()

Renders the checkbox.

This is changed to use the actual provided value of the value attribute to support selecting object values.

Return Value

string

protected string getNameWithoutPrefix()

Get the name of this form element, without prefix.

This is done to prevent the extra __identity being added for objects since it leading to property mapping errors and it works without it.

Return Value

string

name