本文整理汇总了PHP中Zend\Form\Form::setOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::setOptions方法的具体用法?PHP Form::setOptions怎么用?PHP Form::setOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Form\Form
的用法示例。
在下文中一共展示了Form::setOptions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setOptions
/**
* Accepted options for FilterForm:
* - filters: a container with the available filters. The filters will be
* added as text fields to the filter fieldset.
*
* @param array|Traversable $options Options
*
* @return FilterForm
*/
public function setOptions($options)
{
parent::setOptions($options);
if (isset($options['filters'])) {
$this->setFilters($options['filters']);
}
return $this;
}
示例2: setOptions
public function setOptions($options)
{
$desc = isset($this->options['description']) ? $this->options['description'] : null;
parent::setOptions($options);
if (isset($options['enable_descriptions'])) {
$this->setIsDescriptionsEnabled($options['enable_descriptions']);
}
if (!isset($options['description']) && null !== $desc) {
$this->options['description'] = $desc;
}
}
示例3: setOptions
public function setOptions($options)
{
parent::setOptions($options);
$options = $this->options;
// assure array
if (isset($options['elements_fieldset'])) {
$this->elementsFieldset = $options['elements_fieldset'];
}
if (isset($options['buttons_fieldset'])) {
$this->buttonsFieldset = $options['buttons_fieldset'];
}
if (isset($options['name'])) {
$this->setName($options['name']);
}
return $this;
}
示例4: setOptions
/**
* {@inheritDoc}
*/
public function setOptions($options)
{
parent::setOptions($options);
if (isset($options['use_form_label'])) {
$this->setUseFormLabel($options['use_form_label']);
}
if (array_key_exists('form_timeout', $options)) {
$this->setFormTimeout($options['form_timeout']);
if (null !== $options['form_timeout'] && !isset($options['use_csrf'])) {
$options['use_csrf'] = true;
}
}
if (isset($options['use_csrf'])) {
$this->setUseCsrf($options['use_csrf']);
}
if (!empty($options['captcha_options'])) {
$this->setCaptchaOptions($options['captcha_options']);
if (!isset($options['use_captcha'])) {
$options['use_captcha'] = true;
}
}
if (isset($options['use_captcha'])) {
$this->setUseCaptcha($options['use_captcha']);
}
if (isset($options['use_submit_element'])) {
$this->setUseSubmitElement($options['use_submit_element']);
}
if (isset($options['use_reset_element'])) {
$this->setUseResetElement($options['use_reset_element']);
}
if (isset($options['merge_input_filter'])) {
$this->setMergeInputFilter($options['merge_input_filter']);
}
if (isset($options['priority_step'])) {
$this->setPriorityStep($options['priority_step']);
}
if (isset($options['element_group'])) {
$this->setElementGroup($options['element_group'], false);
}
return $this;
}