本文整理汇总了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();
}
示例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);
}
}
示例3: setDefaultOptions
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults($this->getDefaultOptions());
$resolver->addAllowedValues($this->getAllowedOptionValues());
}
示例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)));
}
示例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)));
}
示例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)));
}