本文整理汇总了PHP中Symfony\Component\OptionsResolver\OptionsResolver::isDefined方法的典型用法代码示例。如果您正苦于以下问题:PHP OptionsResolver::isDefined方法的具体用法?PHP OptionsResolver::isDefined怎么用?PHP OptionsResolver::isDefined使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\OptionsResolver\OptionsResolver
的用法示例。
在下文中一共展示了OptionsResolver::isDefined方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testClearedOptionsAreNotDefined
public function testClearedOptionsAreNotDefined()
{
$this->assertFalse($this->resolver->isDefined('foo'));
$this->resolver->setDefined('foo');
$this->assertTrue($this->resolver->isDefined('foo'));
$this->resolver->clear();
$this->assertFalse($this->resolver->isDefined('foo'));
}
示例2: addChoiceLoaderNormalizer
/**
* @param OptionsResolver $resolver The options resolver
*/
protected function addChoiceLoaderNormalizer(OptionsResolver $resolver)
{
$choiceListFactory = $this->choiceListFactory;
if ($resolver->isDefined('choice_loader')) {
$resolver->setNormalizer('choice_loader', function (Options $options, $value) use($choiceListFactory) {
if ($options['select2']['enabled']) {
$value = Select2Util::convertToDynamicLoader($choiceListFactory, $options, $value);
$value->setAllowAdd($options['select2']['tags']);
if ($value instanceof AjaxChoiceLoaderInterface) {
$value->setPageSize($options['select2']['ajax_page_size']);
$value->setPageNumber(1);
$value->setSearch('');
$value->setIds(array());
$value->reset();
}
}
return $value;
});
}
}