当前位置: 首页>>代码示例>>PHP>>正文


PHP Element::setOptions方法代码示例

本文整理汇总了PHP中Zend\Form\Element::setOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Element::setOptions方法的具体用法?PHP Element::setOptions怎么用?PHP Element::setOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\Form\Element的用法示例。


在下文中一共展示了Element::setOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setOptions

 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($options['form'])) {
         $this->setForm($options['form']);
     }
 }
开发者ID:cross-solution,项目名称:yawik,代码行数:7,代码来源:DisableElementsCapableFormSettings.php

示例2: setOptions

 /**
  * Set options for a fieldset. Accepted options are:
  * - use_as_base_fieldset: is this fieldset use as the base fieldset?
  *
  * @param  array|Traversable $options
  * @return Element|ElementInterface
  * @throws Exception\InvalidArgumentException
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($options['use_as_base_fieldset'])) {
         $this->setUseAsBaseFieldset($options['use_as_base_fieldset']);
     }
     return $this;
 }
开发者ID:gstearmit,项目名称:EshopVegeTable,代码行数:16,代码来源:Fieldset.php

示例3: setOptions

 /**
  * Accepted options for DateTime:
  * - format: A \DateTime compatible string
  *
  * @param array|\Traversable $options
  * @return DateTime
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($this->options['format'])) {
         $this->setFormat($this->options['format']);
     }
     return $this;
 }
开发者ID:mindfeederllc,项目名称:openemr,代码行数:15,代码来源:DateTime.php

示例4: setOptions

 /**
  * Accepted options for Captcha:
  * - captcha: a valid Zend\Captcha\AdapterInterface
  *
  * @param array|Traversable $options
  * @return Captcha
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($this->options['captcha'])) {
         $this->setCaptcha($this->options['captcha']);
     }
     return $this;
 }
开发者ID:Flesh192,项目名称:magento,代码行数:15,代码来源:Captcha.php

示例5: setOptions

 /**
  * Accepted options for Csrf:
  * - csrf_options: an array used in the Csrf
  *
  * @param array|\Traversable $options
  * @return Csrf
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($options['csrf_options'])) {
         $this->setCsrfValidatorOptions($options['csrf_options']);
     }
     return $this;
 }
开发者ID:eltondias,项目名称:Relogio,代码行数:15,代码来源:Csrf.php

示例6: addElement

 /**
  * @param Element $element
  */
 public function addElement($element)
 {
     $options = $element->getOptions();
     $options['displayGroup'] = $this->getName();
     $element->setOptions($options);
     $this->elements[$element->getName()] = $element;
     return $this;
 }
开发者ID:NguyenQuiDuong,项目名称:Funixtest,代码行数:11,代码来源:DisplayGroup.php

示例7: testCanCreateLabelValueAfterInput

 public function testCanCreateLabelValueAfterInput()
 {
     $element = new Element('foo');
     $element->setOptions(array('label' => 'The value for foo:'));
     $this->helper->setLabelPosition('append');
     $markup = $this->helper->render($element);
     $this->assertContains('<label><input', $markup);
     $this->assertContains('</label>', $markup);
 }
开发者ID:razvansividra,项目名称:pnlzf2-1,代码行数:9,代码来源:FormRowTest.php

示例8: setOptions

 /**
  * Set options for a fieldset. Accepted options are:
  * - use_as_base_fieldset: is this fieldset use as the base fieldset?
  *
  * @param  array|Traversable $options
  * @return Element|ElementInterface
  * @throws Exception\InvalidArgumentException
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($options['use_as_base_fieldset'])) {
         $this->setUseAsBaseFieldset($options['use_as_base_fieldset']);
     }
     if (isset($options['allowed_object_binding_class'])) {
         $this->setAllowedObjectBindingClass($options['allowed_object_binding_class']);
     }
     return $this;
 }
开发者ID:robertboloc,项目名称:zf2,代码行数:19,代码来源:Fieldset.php

示例9: setOptions

 /**
  * Set options for an element. Accepted options are:
  * - label: label to associate with the element
  * - label_attributes: attributes to use when the label is rendered
  * - value_options: list of values and labels for the select options
  *
  * @param  array|\Traversable $options
  * @return Select|ElementInterface
  * @throws Exception\InvalidArgumentException
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($this->options['value_options'])) {
         $this->setValueOptions($this->options['value_options']);
     }
     // Alias for 'value_options'
     if (isset($this->options['options'])) {
         $this->setValueOptions($this->options['options']);
     }
     return $this;
 }
开发者ID:nuxwin,项目名称:zf2,代码行数:22,代码来源:Select.php

示例10: setOptions

 /**
  * reCAPTCHA options
  * - site_key: Public key (html)
  * - secret_key: Private key
  * - remote_ip: Check IP
  *
  * @param  array|\Traversable $options
  * @return self
  * @throws Exception\InvalidArgumentException
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (empty($options['site_key']) || empty($options['secret_key'])) {
         throw new Exception\InvalidArgumentException('The options site_key and/or secret_key were not found');
     }
     $this->setSiteKey($options['site_key']);
     $this->setSecretKey($options['secret_key']);
     if (isset($options['remote_ip'])) {
         $this->setRemoteIp($options['remote_ip']);
     }
     return $this;
 }
开发者ID:basselin,项目名称:zf2-new-recaptcha,代码行数:23,代码来源:NewReCaptcha.php

示例11: setOptions

 /**
  * Accepted options for MultiCheckbox:
  * - use_hidden_element: do we render hidden element?
  * - unchecked_value: value for checkbox when unchecked
  * - checked_value: value for checkbox when checked
  *
  * @param  array|\Traversable $options
  * @return Checkbox
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($options['use_hidden_element'])) {
         $this->setUseHiddenElement($options['use_hidden_element']);
     }
     if (isset($options['unchecked_value'])) {
         $this->setUncheckedValue($options['unchecked_value']);
     }
     if (isset($options['checked_value'])) {
         $this->setCheckedValue($options['checked_value']);
     }
     return $this;
 }
开发者ID:Rovak,项目名称:zf2,代码行数:23,代码来源:Checkbox.php

示例12: setOptions

 /**
  * Accepted options for DoctrineEntity:
  * - object_manager: a valid Doctrine 2 ObjectManager
  * - target_class: a FQCN of the target entity
  * - property: the property of the entity to use as the label in the options
  * - spec: a closure, QueryBuilder or Query
  *
  * @param  array|\Traversable $options
  * @return DoctrineEntity
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($options['object_manager'])) {
         $this->setObjectManager($options['object_manager']);
     }
     if (isset($options['target_class'])) {
         $this->setTargetClass($options['target_class']);
     }
     if (isset($options['property'])) {
         $this->setProperty($options['property']);
     }
     if (isset($options['spec'])) {
         $this->setSpec($options['spec']);
     }
     return $this;
 }
开发者ID:ashimidashajia,项目名称:zendstore,代码行数:27,代码来源:DoctrineEntity.php

示例13: setOptions

 /**
  * Set options for an element. Accepted options are:
  * - label: label to associate with the element
  * - label_attributes: attributes to use when the label is rendered
  * - value_options: list of values and labels for the select options
  * _ empty_option: should an empty option be prepended to the options ?
  *
  * @param  array|Traversable $options
  * @return Select|ElementInterface
  * @throws InvalidArgumentException
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($this->options['value_options'])) {
         $this->setValueOptions($this->options['value_options']);
     }
     // Alias for 'value_options'
     if (isset($this->options['options'])) {
         $this->setValueOptions($this->options['options']);
     }
     if (isset($this->options['empty_option'])) {
         $this->setEmptyOption($this->options['empty_option']);
     }
     if (isset($this->options['disable_inarray_validator'])) {
         $this->setDisableInArrayValidator($this->options['disable_inarray_validator']);
     }
     return $this;
 }
开发者ID:eltondias,项目名称:Relogio,代码行数:29,代码来源:Select.php

示例14: setOptions

 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($options['startdate'])) {
         if (isset($options['startdate']['options'])) {
             $this->getStartDateElement()->setOptions($options['startdate']['options']);
         }
         if (isset($options['startdate']['attributes'])) {
             $this->getStartDateElement()->setAttributes($options['startdate']['attributes']);
         }
     }
     if (isset($options['enddate'])) {
         if (isset($options['enddate']['options'])) {
             $this->getEndDateElement()->setOptions($options['enddate']['options']);
         }
         if (isset($options['enddate']['attributes'])) {
             $this->getEndDateElement()->setAttributes($options['enddate']['attributes']);
         }
     }
 }
开发者ID:webpants,项目名称:YAWIK,代码行数:20,代码来源:DateRange.php

示例15: getForm

 public function getForm($article, $entityManager, $myEntity, $action)
 {
     $builder = new DoctrineAnnotationBuilder($entityManager);
     $form = $builder->createForm($article);
     //!!!!!! Start !!!!! Added to make the association tables work with select
     foreach ($form->getElements() as $element) {
         if (method_exists($element, 'getProxy')) {
             $proxy = $element->getProxy();
             if (method_exists($proxy, 'setObjectManager')) {
                 $proxy->setObjectManager($entityManager);
             }
         }
     }
     $form->setHydrator(new DoctrineHydrator($entityManager, $myEntity));
     $oName = new Element('name');
     $oName->setAttributes(array('type' => 'text', 'maxlength' => 255));
     $oName->setOptions(array('label' => 'Название'));
     $form->add($oName, array('priority' => 1000));
     $oDescription = new Element('description');
     $oDescription->setAttributes(array('type' => 'text', 'maxlength' => 255));
     $oDescription->setOptions(array('label' => 'Описание'));
     $form->add($oDescription, array('priority' => 999));
     $send = new Element('send');
     $send->setValue($action);
     // submit
     $send->setAttributes(array('type' => 'submit'));
     $form->add($send);
     foreach ($form->getElements() as $element) {
         $element->setAttribute('id', $element->getName());
         $element->setAttribute('class', 'form-control');
         /*if ($element->getLabel() === null) {
               $element->setOptions(array('add-on-div' => array('class'  => 'col-sm-offset-2 col-sm-10'), ));
           } else {
               $element->setOptions(array( 'add-on-div' => array('class'  => 'col-sm-10'), 
                                       'label_attributes' => array('class'  => 'col-sm-2 control-label'),
                                 ));
           }*/
     }
     return $form;
 }
开发者ID:sudar69,项目名称:hermes,代码行数:40,代码来源:WidgetForm.php


注:本文中的Zend\Form\Element::setOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。