File indexing completed on 2024-12-22 05:36:42
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_Form 0017 * @subpackage Element 0018 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0019 * @license http://framework.zend.com/license/new-bsd New BSD License 0020 */ 0021 0022 /** Zend_Form_Element_Multi */ 0023 // require_once 'Zend/Form/Element/Multi.php'; 0024 0025 /** 0026 * MultiCheckbox form element 0027 * 0028 * Allows specifyinc a (multi-)dimensional associative array of values to use 0029 * as labelled checkboxes; these will return an array of values for those 0030 * checkboxes selected. 0031 * 0032 * @category Zend 0033 * @package Zend_Form 0034 * @subpackage Element 0035 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0036 * @license http://framework.zend.com/license/new-bsd New BSD License 0037 * @version $Id$ 0038 */ 0039 class Zend_Form_Element_MultiCheckbox extends Zend_Form_Element_Multi 0040 { 0041 /** 0042 * Use formMultiCheckbox view helper by default 0043 * @var string 0044 */ 0045 public $helper = 'formMultiCheckbox'; 0046 0047 /** 0048 * MultiCheckbox is an array of values by default 0049 * @var bool 0050 */ 0051 protected $_isArray = true; 0052 0053 /** 0054 * Load default decorators 0055 * 0056 * @return Zend_Form_Element_MultiCheckbox 0057 */ 0058 public function loadDefaultDecorators() 0059 { 0060 if ($this->loadDefaultDecoratorsIsDisabled()) { 0061 return $this; 0062 } 0063 0064 parent::loadDefaultDecorators(); 0065 0066 // Disable 'for' attribute 0067 if (false !== $decorator = $this->getDecorator('label')) { 0068 $decorator->setOption('disableFor', true); 0069 } 0070 0071 return $this; 0072 } 0073 }