Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to use Zend Framework's formCheckbox View Helper

DZone's Guide to

How to use Zend Framework's formCheckbox View Helper

· Web Dev Zone
Free Resource

Tips, tricks and tools for creating your own data-driven app, brought to you in partnership with Qlik.

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); ?>

Explore data-driven apps with less coding and query writing, brought to you in partnership with Qlik.

Topics:

Published at DZone with permission of Svetoslav Marinov, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}