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


PHP AbstractType::configureOptions方法代码示例

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


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

示例1: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     if ($this->formType) {
         $this->formType->configureOptions($resolver);
     }
 }
开发者ID:adam-paterson,项目名称:orocommerce,代码行数:10,代码来源:EntitySelectTypeStub.php

示例2: configureOptions

 /**
  * @param OptionsResolver $resolver
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(['format' => $this->format, 'invalid_message' => 'This value should be in format {{ format }}', 'invalid_message_parameters' => function (Options $options) {
         return ['{{ format }}' => $options['format']];
     }, 'widget' => $this->widget]);
 }
开发者ID:juliendufresne,项目名称:JDFormBundle,代码行数:10,代码来源:DateType.php

示例3: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('nameable' => false, 'deleteable' => false, 'downloadable' => true, 'maxWidth' => 320, 'maxHeight' => 180, 'minWidth' => 16, 'minHeight' => 16, 'previewImages' => true, 'previewAsCanvas' => true, 'previewFilter' => null, 'multipart' => true, 'novalidate' => true, 'required' => false));
     $resolver->setAllowedValues('multipart', array(true))->setAllowedValues('novalidate', array(true))->setAllowedValues('required', array(false));
     $resolver->setAllowedTypes('nameable', array('string', 'bool'))->setAllowedTypes('deleteable', array('string', 'bool'))->setAllowedTypes('downloadable', array('bool'))->setAllowedTypes('maxWidth', array('integer'))->setAllowedTypes('maxHeight', array('integer'))->setAllowedTypes('minWidth', array('integer'))->setAllowedTypes('minHeight', array('integer'))->setAllowedTypes('previewImages', array('bool'))->setAllowedTypes('previewAsCanvas', array('bool'))->setAllowedTypes('previewFilter', array('string', 'null'));
 }
开发者ID:Lionel09,项目名称:FormExtensionsBundle,代码行数:10,代码来源:SingleUploadType.php

示例4: configureOptions

 /**
  * Form type default options
  *
  * @param OptionsResolver $resolver The resolver.
  *
  * @return array
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefault('data_class', function (Options $options) {
         return $options['isORM'] ? 'PhpInk\\Nami\\CoreBundle\\Model\\Orm\\User' : 'PhpInk\\Nami\\CoreBundle\\Model\\Odm\\User';
     });
     $resolver->setDefaults('intention', 'resetting');
 }
开发者ID:phpink,项目名称:nami-core-bundle,代码行数:15,代码来源:UserResetType.php

示例5: configureOptions

 /**
  * @param OptionsResolver $resolver
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $dataClass = function (Options $options) {
         return $options['class'];
     };
     $resolver->setDefaults(array('class' => null, 'data_class' => $dataClass, 'translation_domain' => 'messages', 'horizontal' => true, 'horizontal_input_wrapper_class' => 'col-md-12', 'horizontal_label_offset_class' => ''));
 }
开发者ID:rapemer,项目名称:init-cms-bundle,代码行数:11,代码来源:ContentType.php

示例6: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('acceptFileTypes' => '/.*$/i', 'autoUpload' => false, 'editable' => array(), 'displayDownloadButton' => true, 'loadImageFileTypes' => '/^image\\/(gif|jpe?g|png)$/i', 'loadImageMaxFileSize' => 5000000, 'maxNumberOfFiles' => null, 'maxFileSize' => null, 'minFileSize' => null, 'multipart' => true, 'multiple' => true, 'nameable' => true, 'nameable_field' => 'name', 'novalidate' => true, 'prependFiles' => false, 'previewAsCanvas' => true, 'previewFilter' => null, 'itemFilter' => null, 'previewMaxHeight' => 80, 'previewMaxWidth' => 80, 'primary_key' => 'id', 'required' => false, 'sortable' => false, 'sortable_field' => 'position', 'uploadRouteName' => null, 'uploadRouteParameters' => array()));
     // This seems weird... why to we accept it as option if we force
     // its value?
     $resolver->setAllowedValues('novalidate', array(true))->setAllowedValues('multipart', array(true))->addAllowedValues('multiple', array(true))->setAllowedValues('required', array(false));
     $resolver->setAllowedTypes('acceptFileTypes', array('string'))->setAllowedTypes('autoUpload', array('bool'))->setAllowedTypes('editable', array('array'))->setAllowedTypes('displayDownloadButton', array('bool'))->setAllowedTypes('loadImageFileTypes', array('string'))->setAllowedTypes('loadImageMaxFileSize', array('integer'))->setAllowedTypes('maxNumberOfFiles', array('integer', 'null'))->setAllowedTypes('maxFileSize', array('integer', 'null'))->setAllowedTypes('minFileSize', array('integer', 'null'))->setAllowedTypes('multipart', array('bool'))->setAllowedTypes('multiple', array('bool'))->setAllowedTypes('nameable', array('bool'))->setAllowedTypes('nameable_field', array('string', 'null'))->setAllowedTypes('novalidate', array('bool'))->setAllowedTypes('prependFiles', array('bool'))->setAllowedTypes('previewAsCanvas', array('bool'))->setAllowedTypes('previewFilter', array('string', 'null'))->setAllowedTypes('itemFilter', array('string', 'null'))->setAllowedTypes('previewMaxWidth', array('integer'))->setAllowedTypes('previewMaxHeight', array('integer'))->setAllowedTypes('primary_key', array('string'))->setAllowedTypes('required', array('bool'))->setAllowedTypes('sortable', array('bool'))->setAllowedTypes('sortable_field', array('string'))->setAllowedTypes('uploadRouteName', array('string', 'null'))->setAllowedTypes('uploadRouteParameters', array('array'));
 }
开发者ID:Lionel09,项目名称:FormExtensionsBundle,代码行数:12,代码来源:CollectionUploadType.php

示例7: configureOptions

 /**
  * {@inheritDoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     // TODO: Remove conditional parent call when bumping requirements to SF 2.7+
     if (method_exists('Symfony\\Component\\Form\\AbstractType', 'configureOptions')) {
         parent::configureOptions($resolver);
     } else {
         parent::setDefaultOptions($resolver);
     }
     $resolver->setDefaults(array('map' => array()));
 }
开发者ID:ronanguilloux,项目名称:SonataAdminBundle,代码行数:13,代码来源:ChoiceFieldMaskType.php

示例8: configureOptions

 /**
  * @param OptionsResolver $resolver
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefault('mao', null);
     $resolver->setDefaults(['data_class' => Metadata::class]);
     $resolver->setDefaults(['type_options' => []]);
     $resolver->setDefaults(['type_forms' => []]);
     $resolver->setAllowedTypes('type_options', ['array']);
     $resolver->setAllowedTypes('mao', [MetadataAccessObject::class]);
 }
开发者ID:dumplie,项目名称:dumplie,代码行数:13,代码来源:MetadataType.php

示例9: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(['choices' => function (Options $options) {
         if (null === $options['enabled']) {
             return $this->localeRepository->findAll();
         }
         return $this->localeRepository->findBy(['enabled' => $options['enabled']]);
     }, 'choice_value' => 'code', 'choice_label' => 'name', 'choice_translation_domain' => false, 'enabled' => null, 'label' => 'sylius.form.locale.locale', 'placeholder' => 'sylius.form.locale.select']);
 }
开发者ID:sylius,项目名称:sylius,代码行数:13,代码来源:LocaleChoiceType.php

示例10: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setRequired('resource')->setAllowedTypes('resource', ResourceInterface::class)->setDefaults(['class' => function (Options $options) {
         return $options['resource']->getModel();
     }, 'choice_value' => function (Options $options) {
         return $options['resource']->getIdPropertyPath();
     }, 'choice_label' => function (Options $options) {
         return $options['resource']->getLabelPropertyPath();
     }, 'placeholder' => '']);
 }
开发者ID:php-lug,项目名称:lug,代码行数:14,代码来源:ResourceChoiceType.php

示例11: getConstraints

 /**
  * @param  AbstractType $type
  * @param  string       $groups
  * @return array
  *
  * Get an array with the type's constraints loaded with groups
  */
 protected function getConstraints(AbstractType $type, $groups = "Default")
 {
     /**
      * Create a resolver to get the options
      */
     $nullResolver = new OptionsResolver();
     $type->configureOptions($nullResolver);
     $options = $nullResolver->resolve();
     if (!isset($options["constraints"])) {
         $options["constraints"] = array();
     }
     /**
      * Then replace groups
      */
     $constraints = $this->replaceGroups($groups, $options["constraints"]);
     return $constraints;
 }
开发者ID:vigourouxjulien,项目名称:thelia,代码行数:24,代码来源:AbstractTheliaType.php

示例12: configureOptions

 /**
  * @param OptionsResolver $resolver
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('csrf_protection' => false, 'allow_extra_fields' => true, 'cascade_validation' => true));
 }
开发者ID:uniquelibs,项目名称:api-bundle,代码行数:8,代码来源:ApiAbstractType.php

示例13: configureOptions

 /**
  * @param OptionsResolver $resolver
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('data_class' => 'AppBundle\\Entity\\Profile'));
 }
开发者ID:EnoahNetzach,项目名称:prontopro-test,代码行数:8,代码来源:ProfileType.php

示例14: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults([]);
 }
开发者ID:Niiko,项目名称:Sylius,代码行数:8,代码来源:ResourceTranslationsType.php

示例15: configureOptions

 /**
  * @param OptionsResolver $resolver
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('method' => 'GET', 'csrf_protection' => false));
 }
开发者ID:saxulum,项目名称:saxulum-crud,代码行数:8,代码来源:SampleListType.php


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