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


PHP OptionsResolverInterface::addAllowedValues方法代码示例

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


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

示例1: setDefaultOptions

 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     set_error_handler(array('Symfony\\Component\\Form\\Test\\DeprecationErrorHandler', 'handleBC'));
     $resolver->setDefaults($this->getDefaultOptions(array()));
     $resolver->addAllowedValues($this->getAllowedOptionValues(array()));
     restore_error_handler();
 }
开发者ID:ronnylt,项目名称:symfony,代码行数:10,代码来源:AbstractType.php

示例2: setDefaultOptions

 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     $defaults = $this->getDefaultOptions(array());
     $allowedTypes = $this->getAllowedOptionValues(array());
     if (!empty($defaults)) {
         trigger_error('getDefaultOptions() is deprecated since version 2.1 and will be removed in 2.3. Use setDefaultOptions() instead.', E_USER_DEPRECATED);
         $resolver->setDefaults($defaults);
     }
     if (!empty($allowedTypes)) {
         trigger_error('getAllowedOptionValues() is deprecated since version 2.1 and will be removed in 2.3. Use setDefaultOptions() instead.', E_USER_DEPRECATED);
         $resolver->addAllowedValues($allowedTypes);
     }
 }
开发者ID:ronaldlunaramos,项目名称:webstore,代码行数:16,代码来源:AbstractType.php

示例3: setDefaultOptions

 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     $resolver->setDefaults($this->getDefaultOptions());
     $resolver->addAllowedValues($this->getAllowedOptionValues());
 }
开发者ID:nathanlon,项目名称:symfony,代码行数:8,代码来源:AbstractType.php

示例4: setDefaultOptions

 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     $resolver->setDefaults(array('required' => false, 'config_name' => 'boxit_default', 'config' => array()));
     $resolver->addAllowedValues(array('required' => array(false)));
 }
开发者ID:rmzamora,项目名称:FormExtensionBundle,代码行数:8,代码来源:BoxItSelectType.php

示例5: setDefaultOptions

 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     $resolver->setDefaults(array('model_manager' => null, 'class' => null, 'required' => false, 'provider_name' => false, 'context' => false, 'admin_code' => 'sonata.media.admin.media', 'error_bubbling' => false, 'compound' => false));
     $resolver->setRequired(array('class'));
     $resolver->addAllowedValues(array('required' => array(false)));
 }
开发者ID:lzdv,项目名称:init-cms-bundle,代码行数:9,代码来源:MediaEntityType.php

示例6: setDefaultOptions

 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     $resolver->setDefaults(array('password_required' => false, 'data_class' => 'Kunstmaan\\AdminBundle\\Entity\\User'));
     $resolver->addAllowedValues(array('password_required' => array(true, false)));
 }
开发者ID:headonkeyboard,项目名称:KunstmaanBundlesCMS,代码行数:8,代码来源:UserType.php


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