Platinum Partner
php,css

How to use Zend Framework's formCheckbox View Helper

I am almost always going back to check the syntax of  formCheckbox Zend Framework View Help so I decided to post it here.
<?php echo $this->formCheckbox('data[enabled]', 1, null, array(1, 0)); ?>
OR
<?php echo $this->formCheckbox('data[enabled]', 1, !empty($this->data['enabled']) ? array('checked' => 1) : null); ?>

Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}