public function __construct($spec, $options = array()) { $options = array_merge($options, array('disableLoadDefaultDecorators' => true)); parent::__construct($spec, $options); $this->_decorator = new Monkeys_Form_Decorator_Composite(); $this->addDecorator($this->_decorator); }
/** * Constructor * * @param string|array|Zend_Config $spec Element name or configuration * @param string|array|Zend_Config $options Element value or configuration * @return void */ public function __construct($spec, $options = null) { if (is_string($spec) && (null !== $options && is_string($options))) { $options = array('label' => $options); } parent::__construct($spec, $options); }
/** * Constructor * * Creates session namespace for CSRF token, and adds validator for CSRF * token. * * @param string|array|Zend_Config $spec * @param array|Zend_Config $options * @return void */ public function __construct($spec, $options = null) { parent::__construct($spec, $options); $this->setAllowEmpty(false) ->setRequired(true) ->initCsrfValidator(); }
/** * constructor * @param $spec * @param $options */ public function __construct($spec, $options = null) { $objLoader = new PluginLoader(); $objLoader->setPluginLoader($this->getPluginLoader(PluginLoader::TYPE_FORM_DECORATOR)); $objLoader->setPluginType(PluginLoader::TYPE_FORM_DECORATOR); $this->setPluginLoader($objLoader, PluginLoader::TYPE_FORM_DECORATOR); parent::__construct($spec, $options); }
public function __construct($spec, $options = null) { $localOptions = array('filters' => array('StringTrim')); if (isset($options)) { $options = array_replace_recursive($localOptions, $options); } else { $options = $localOptions; } parent::__construct($spec, $options); }
public function __construct($spec, $options = null) { $localOptions = array('filters' => array('StringTrim'), 'label' => 'Date and time', 'validators' => array(new \Tillikum\Validate\FormDatetime())); if (isset($options)) { $options = array_replace_recursive($localOptions, $options); } else { $options = $localOptions; } parent::__construct($spec, $options); }
/** * Constructor * * @param string|array|Zend_Config $spec Element name or configuration * @param string|array|Zend_Config $options Element value or configuration * @return void */ public function __construct($spec, $options = null) { if (is_string($spec) && (null !== $options && is_string($options))) { $options = array('label' => $options); } if (!isset($options['ignore'])) { $options['ignore'] = true; } parent::__construct($spec, $options); }
/** * Определяем массив ролей и уровней доступа и дергаем родительский конструктор * * @param unknown_type $spec * @param unknown_type $options */ public function __construct($spec, $options = null) { /** * @see Phorm_User */ require_once "Phorm/User.php"; $User = new Phorm_User(); $options['roles'] = $User->getRolesListAsPairs(); $options['levels'] = $User->getAccessLevelsAsPairs(); parent::__construct($spec, $options); }
/** * Определяем массив опций и дергаем родительский конструктор * * @param mixed $spec * @param array $options */ public function __construct($spec, $options = null) { $this->translate = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('Translate'); /** * Выделяем дополнительные элементы в отдельную форму и рендерим ее */ require_once 'Phorm/Form.php'; if (isset($options['elements']) && is_array($options['elements'])) { $config = array('elements' => $options['elements']); if (isset($options['paths']['prefixPath'])) { $config['prefixPath'] = array_values($options['paths']['prefixPath']); } if (isset($options['paths']['elementPrefixPath'])) { $config['elementPrefixPath'] = array_values($options['paths']['elementPrefixPath']); } /*foreach ($options as $key=>$option) { if(!in_array($key,array('elements','prefixPath','elementPrefixPath'))) { unset($options[$key]); } }*/ $form = new Phorm_Form(null, null, $config); $form->removeDecorator('Form'); $form->removeDecorator('DtDdWrapper'); $form->setElementsBelongTo($spec . '[]'); $this->renderform = $form->render() . '<div class="clear"></div>'; unset($options['elements'], $config['elements']); foreach ($form->getElements() as $element) { $element->setAttrib('id', null); } $this->form = $form; } /** * Инициализируем родительский конструктор */ parent::__construct($spec, $options); }
/** * Constructor * * $spec may be: * - string: name of element * - array: options with which to configure element * - Zend_Config: Zend_Config with options for configuring element * * * Chosen options can be set in array two ways first by DQL second simple array. * * To set options by DQL $options array structure should be like: * [ * 'dql' => "select u.username from \\Entities\\User where u.username IS NOT NULL", //mandatory * 'db' => "default" //Optional if db is not default. Some project may have more then one. * ] * * To set options by array $options array structure should be like: * [ * 'options' => [ 'option1' => 'option1', 'option2' => 'option2', 'option3' => 'option3' ], //mandatory * ] * * * @param string|array|Zend_Config $spec * @return void * * @see setChosenOptions() * @see setChosenOptionsByDql() */ public function __construct($spec, $options = null) { if (isset($options['options'])) { $this->setChosenOptions($options['options']); unset($options['options']); } else { if (isset($options['dql'])) { if (isset($options['db'])) { $this->setChosenOptionsByDql($options['dql'], $options['db']); unset($options['db']); } else { $this->setChosenOptionsByDql($options['dql']); } unset($options['dql']); } } parent::__construct($spec, $options); }
public function __construct($spec, $options = null) { parent::__construct($spec, $options); }
/** * Constructor * * @param string $spec * @param array $options * @return void */ public function __construct($spec, $options = null) { $this->addPrefixPath('Rexmac\\Zyndax\\Form\\Decorator\\', 'Rexmac/Zyndax/Form/Decorator', 'decorator'); parent::__construct($spec, $options); }
/** * Constructor * * $spec may be: * - string: name of element * - array: options with which to configure element * - \Zend_Config: \Zend_Config with options for configuring element * * @param \Zend_Form $subForm * @param string|array|\Zend_Config $spec * @throws \Zend_Form_Exception if no element name after initialization */ public function __construct(\Zend_Form $subForm, $spec, $options = null) { $this->setSubForm($subForm); parent::__construct($spec, $options); }
/** * Constructor * * @param string $spec * @param array $options * @return void */ public function __construct($spec, $options = null) { $this->addPrefixPath('Rexmac\\Zyndax\\Form\\Decorator\\', 'Rexmac/Zyndax/Form/Decorator', 'decorator'); $this->setTimeZone(isset($options['timeZone']) ? $options['timeZone'] : new DateTimeZone('UTC')); $this->setRangedDates(self::_calculateRangedDates($this->getTimeZone())); $this->setRange(self::TODAY); parent::__construct($spec, $options); }
/** * Инициализируем переводчик и дергаем родительский конструктор * * @param mixed $spec * @param array $options */ public function __construct($spec, $options = null) { $this->translate = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('Translate'); parent::__construct($spec, $options); }
/** * Constructor * * $spec may be: * - string: name of element * - array: options with which to configure element * - Zend_Config: Zend_Config with options for configuring element * * @param string|array|Zend_Config $spec * @return void */ public function __construct($spec, $options = null) { parent::__construct($spec, $options); $this->setAllowEmpty(true)->setRequired(true)->setAutoInsertNotEmptyValidator(false)->addValidator($this->getCaptcha(), true); }
public function __construct($spec, $options = null) { $this->addPrefixPath('Zwe_Form_Decorator', 'Zwe/Form/Decorator', 'decorator'); parent::__construct($spec, $options); }