本文整理匯總了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;
}