本文整理汇总了PHP中Zend_Form::setOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form::setOptions方法的具体用法?PHP Zend_Form::setOptions怎么用?PHP Zend_Form::setOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form
的用法示例。
在下文中一共展示了Zend_Form::setOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* @param array $config
* @param array $params
* @return ZF1
*/
public function create(array $config, array $params)
{
$form = new ZF1();
$formComponent = new \Zend_Form();
$formComponent->setOptions($config['form']);
foreach ($this->getActiveGroups($config['groups'], $params) as $groupConfig) {
foreach ($groupConfig['elements'] as $elementConfig) {
$element = $this->getDic()->get('form.element.zf1factory')->create($elementConfig, $params);
$formComponent->addElement($element);
}
}
$form->setFormComponent($formComponent);
return $form;
}
示例2: setOptions
public function setOptions(array $options)
{
if (isset($options['model'])) {
$this->_model = $options['model'];
}
//adapter must be set after the model
if (isset($options['adapter'])) {
$this->setAdapter($options['adapter']);
}
if (isset($options['ignoreFields'])) {
$this->setIgnoreFields($options['ignoreFields']);
}
if (isset($options['columnTypes'])) {
$this->setColumnTypes($options['columnTypes']);
}
if (isset($options['fieldLabels'])) {
$this->setFieldLabels($options['fieldLabels']);
}
if (isset($options['fieldTypes'])) {
$this->setFieldTypes($options['fieldTypes']);
}
if (isset($options['generateManyFields'])) {
$this->setGenerateManyFields($options['generateManyFields']);
}
parent::setOptions($options);
}
示例3: setOptions
/**
* Set form state from options array
*
* @return Zend_Form
*/
public function setOptions()
{
$options = $this->_getOptions()->toArray();
if (isset($options['importDisplayGroups'])) {
$this->_extraDisplayGroups = $options['importDisplayGroups'];
unset($options['importDisplayGroups']);
}
if (!isset($options['id'])) {
$id = $this->_module . '-' . $this->_formConfigFile . '-form';
$id = Zend_Filter::filterStatic($id, 'DashToCamelCase') . mt_rand();
$id = lcfirst($id);
$options['id'] = $id;
}
parent::setOptions($options);
return $this;
}