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


PHP AbstractType::setDefaultOptions方法代码示例

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


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

示例1: setDefaultOptions

 /**
  * @param \Symfony\Component\OptionsResolver\OptionsResolverInterface $resolver
  *
  * @return void
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setRequired('action');
     $resolver->setRequired('fields');
     $resolver->setDefaults(['attr' => ['class' => 'form-inline']]);
 }
开发者ID:spryker,项目名称:Gui,代码行数:12,代码来源:DeleteForm.php

示例2: setDefaultOptions

 /**
  * {@inheritDoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setRequired(array('root'));
     $resolver->setOptional(array('create_in_overlay', 'edit_in_overlay', 'delete_in_overlay'));
     $resolver->setDefaults(array('create_in_overlay' => true, 'edit_in_overlay' => true, 'delete_in_overlay' => true));
 }
开发者ID:Aaike,项目名称:SonataDoctrinePhpcrAdminBundle,代码行数:10,代码来源:TreeManagerType.php

示例3: setDefaultOptions

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

示例4: setDefaultOptions

 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $currencyChoices = $this->currencyManager->getActiveCodes();
     $resolver->replaceDefaults(array('data_type' => NumberFilterType::DATA_DECIMAL));
     $resolver->setDefaults(array('currency_choices' => array_combine($currencyChoices, $currencyChoices), 'currency_options' => array()));
 }
开发者ID:jacko972,项目名称:pim-community-dev,代码行数:10,代码来源:PriceFilterType.php

示例5: setDefaultOptions

 /**
  * @param \Symfony\Component\OptionsResolver\OptionsResolverInterface $resolver
  *
  * @return void
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setRequired(self::OPTION_SALUTATION_CHOICES);
     $resolver->setRequired(self::OPTION_COUNTRY_CHOICES);
     $resolver->setRequired(self::OPTION_PREFERRED_COUNTRY_CHOICES);
 }
开发者ID:spryker,项目名称:Customer,代码行数:12,代码来源:AddressForm.php

示例6: setDefaultOptions

 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setOptional(array('widget_options'));
     $resolver->setAllowedTypes(array('widget_options' => 'array'));
     $resolver->setDefaults(array('mapped' => false, 'error_bubbling' => false, 'constraints' => new Constraints\Recaptcha(), 'widget_options' => array()));
 }
开发者ID:plozmun,项目名称:RecaptchaBundle,代码行数:10,代码来源:RecaptchaType.php

示例7: setDefaultOptions

 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setRequired(array('referenced_class'));
     $resolver->setOptional(array('key'));
     $resolver->setDefaults(array('key' => ReferenceManyCollectionToArrayTransformer::KEY_UUID));
 }
开发者ID:nikophil,项目名称:cmf-tests,代码行数:10,代码来源:PHPCRODMReferenceCollectionType.php

示例8: setDefaultOptions

 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     $resolver->setOptional(['preview', 'media_type', 'select_label', 'change_label', 'select_multiple_label', 'change_multiple_label'])->addAllowedTypes(['preview' => 'string', 'media_type' => 'string', 'select_label' => 'string', 'change_label' => 'string', 'select_multiple_label' => 'string', 'change_multiple_label' => 'string']);
     parent::setDefaultOptions($resolver);
     $compound = function (Options $options) {
         return $options['multiple'];
     };
     $resolver->setDefaults(['class' => 'Hexmedia\\ContentBundle\\Entity\\Media', 'compound' => $compound]);
 }
开发者ID:hexmedia,项目名称:content-bundle,代码行数:9,代码来源:MediaType.php

示例9: setDefaultOptions

 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setDefaults(array('label' => 'Email', 'data_class' => 'HMLB\\UserBundle\\Command\\ChangePassword', 'empty_data' => function (Options $options) {
         return function (FormInterface $form) use($options) {
             return new ChangePassword($form->get('password')->getData(), $form->get('user')->getData());
         };
     }));
 }
开发者ID:hmlb,项目名称:userbundle,代码行数:9,代码来源:ChangePasswordType.php

示例10: setDefaultOptions

 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setDefaults(array('acceptFileTypes' => '/.*$/i', 'autoUpload' => false, 'editable' => array(), '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, '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(array('novalidate' => array(true), 'multipart' => array(true), 'multiple' => array(true), 'required' => array(false)));
     $resolver->setAllowedTypes(array('acceptFileTypes' => array('string'), 'autoUpload' => array('bool'), 'editable' => array('array'), 'loadImageFileTypes' => array('string'), 'loadImageMaxFileSize' => array('integer'), 'maxNumberOfFiles' => array('integer', 'null'), 'maxFileSize' => array('integer', 'null'), 'minFileSize' => array('integer', 'null'), 'multipart' => array('bool'), 'multiple' => array('bool'), 'nameable' => array('bool'), 'nameable_field' => array('string', 'null'), 'novalidate' => array('bool'), 'prependFiles' => array('bool'), 'previewAsCanvas' => array('bool'), 'previewFilter' => array('string', 'null'), 'previewMaxWidth' => array('integer'), 'previewMaxHeight' => array('integer'), 'primary_key' => array('string'), 'required' => array('bool'), 'sortable' => array('bool'), 'sortable_field' => array('string'), 'uploadRouteName' => array('string', 'null'), 'uploadRouteParameters' => array('array')));
 }
开发者ID:arbmainassara,项目名称:AvocodeFormExtensionsBundle,代码行数:12,代码来源:CollectionUploadType.php

示例11: setDefaultOptions

 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $dataClass = function (Options $options) {
         //            return null;
         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:lzdv,项目名称:init-cms-bundle,代码行数:9,代码来源:ContentType.php

示例12: setDefaultOptions

 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setDefaults(array('required' => false, 'condition_pattern' => FilterOperands::STRING_EQUALS, 'compound' => function (Options $options) {
         return $options['condition_pattern'] == FilterOperands::OPERAND_SELECTOR;
     }, 'text_options' => array('required' => false, 'trim' => true), 'choice_options' => array('choices' => FilterOperands::getStringOperandsChoices(), 'required' => false, 'translation_domain' => 'LexikFormFilterBundle'), 'data_extraction_method' => function (Options $options) {
         return $options['compound'] ? 'text' : 'default';
     }))->setAllowedValues(array('data_extraction_method' => array('text', 'default'), 'condition_pattern' => FilterOperands::getStringOperands(true)));
 }
开发者ID:tiitoo,项目名称:mwsform,代码行数:12,代码来源:TextFilterLikeType.php

示例13: 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

示例14: setDefaultOptions

 /**
  * @param \Symfony\Component\OptionsResolver\OptionsResolverInterface $resolver
  *
  * @return void
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setDefaults(['validation_groups' => function (FormInterface $form) {
         $defaultData = $form->getConfig()->getData();
         if (array_key_exists(self::FIELD_FROM_URL, $defaultData) === false || $defaultData[self::FIELD_FROM_URL] !== $form->getData()[self::FIELD_FROM_URL]) {
             return [Constraint::DEFAULT_GROUP, self::GROUP_UNIQUE_URL_CHECK];
         }
         return [Constraint::DEFAULT_GROUP];
     }]);
 }
开发者ID:spryker,项目名称:Cms,代码行数:16,代码来源:CmsRedirectForm.php

示例15: setDefaultOptions

 /**
  * @param \Symfony\Component\OptionsResolver\OptionsResolverInterface $resolver
  *
  * @return void
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setDefaults(['validation_groups' => function (FormInterface $form) {
         $defaultData = $form->getConfig()->getData();
         if (!isset($defaultData[self::FIELD_ID_KEY_MAPPING])) {
             return [Constraint::DEFAULT_GROUP, self::GROUP_PLACEHOLDER_CHECK];
         }
         return [Constraint::DEFAULT_GROUP];
     }]);
 }
开发者ID:spryker,项目名称:Cms,代码行数:16,代码来源:CmsGlossaryForm.php


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