當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。