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.
Published at DZone with permission of Svetoslav Marinov, author and DZone MVB. (source)<?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); ?>
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)
Tags:





