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


PHP FormBuilderInterface::getOptions方法代码示例

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


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

示例1: buildForm

 /**
  *
  * {@inheritdoc}
  *
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     /* get the metadata associate */
     /** @var FieldType $fieldType */
     $fieldType = $builder->getOptions()['metadata'];
     /** @var FieldType $fieldType */
     foreach ($fieldType->getChildren() as $fieldType) {
         if (!$fieldType->getDeleted()) {
             /* merge the default options with the ones specified by the user */
             $options = array_merge(['metadata' => $fieldType, 'label' => false], $fieldType->getDisplayOptions());
             $builder->add('ems_' . $fieldType->getName(), $fieldType->getType(), $options);
         }
     }
 }
开发者ID:theus77,项目名称:ElasticMS,代码行数:19,代码来源:ContainerFieldType.php

示例2: buildForm

 /**
  *
  * {@inheritdoc}
  *
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     /* get the metadata associate */
     /** @var FieldType $fieldType */
     $fieldType = $builder->getOptions()['metadata'];
     /** @var FieldType $fieldType */
     foreach ($fieldType->getChildren() as $fieldType) {
         if (!$fieldType->getDeleted()) {
             /* merge the default options with the ones specified by the user */
             $options = array_merge(['metadata' => $fieldType, 'label' => false], $fieldType->getDisplayOptions());
             $builder->add('ems_' . $fieldType->getName(), $fieldType->getType(), $options);
         }
     }
     $builder->add('remove_collection_item', SubmitEmsType::class, ['attr' => ['class' => 'btn-danger btn-sm remove-content-button'], 'label' => 'Remove', 'icon' => 'fa fa-trash']);
 }
开发者ID:theus77,项目名称:ElasticMS,代码行数:20,代码来源:CollectionItemFieldType.php

示例3: buildForm

 /**
  *
  * {@inheritdoc}
  *
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     /** @var FieldType $fieldType */
     $fieldType = $builder->getOptions()['metadata'];
     $choices = [];
     $values = explode("\n", str_replace("\r", "", $options['choices']));
     $labels = explode("\n", str_replace("\r", "", $options['labels']));
     foreach ($values as $id => $value) {
         if (isset($labels[$id])) {
             $choices[$labels[$id]] = $value;
         } else {
             $choices[$value] = $value;
         }
     }
     $builder->add($options['multiple'] ? 'array_text_value' : 'text_value', ChoiceType::class, ['label' => isset($options['label']) ? $options['label'] : $fieldType->getName(), 'required' => false, 'disabled' => !$this->authorizationChecker->isGranted($fieldType->getMinimumRole()), 'choices' => $choices, 'empty_data' => null, 'multiple' => $options['multiple'], 'expanded' => $options['expanded']]);
 }
开发者ID:theus77,项目名称:ElasticMS,代码行数:21,代码来源:ChoiceFieldType.php

示例4: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     /** @var FieldType $fieldType */
     $fieldType = $builder->getOptions()['metadata'];
     $builder->add('text_value', TextareaType::class, ['attr' => ['rows' => $options['rows']], 'label' => null != $options['label'] ? $options['label'] : $fieldType->getName(), 'required' => false, 'disabled' => !$this->authorizationChecker->isGranted($fieldType->getMinimumRole())]);
 }
开发者ID:theus77,项目名称:ElasticMS,代码行数:9,代码来源:TextareaFieldType.php

示例5: buildForm

 /**
  *
  * {@inheritdoc}
  *
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     /** @var FieldType $fieldType */
     $fieldType = $builder->getOptions()['metadata'];
     $builder->add('float_value', NumberType::class, ['label' => isset($options['label']) ? $options['label'] : $fieldType->getName(), 'required' => false, 'disabled' => !$this->authorizationChecker->isGranted($fieldType->getMinimumRole())]);
 }
开发者ID:theus77,项目名称:ElasticMS,代码行数:11,代码来源:NumberFieldType.php

示例6: buildForm

 /**
  *
  * {@inheritdoc}
  *
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     /* get the metadata associate */
     /** @var FieldType $fieldType */
     $fieldType = clone $builder->getOptions()['metadata'];
     $builder->add('ems_' . $fieldType->getName(), CollectionType::class, array('entry_type' => CollectionItemFieldType::class, 'entry_options' => $options, 'allow_add' => true, 'allow_delete' => true, 'prototype' => true, 'entry_options' => ['metadata' => $fieldType, 'disabled' => !$this->authorizationChecker->isGranted($fieldType->getMinimumRole())]))->add('add_nested', SubmitEmsType::class, ['attr' => ['class' => 'btn-primary btn-sm add-content-button'], 'label' => 'Add', 'disabled' => !$this->authorizationChecker->isGranted($fieldType->getMinimumRole()), 'icon' => 'fa fa-plus']);
 }
开发者ID:theus77,项目名称:ElasticMS,代码行数:12,代码来源:CollectionFieldType.php

示例7: buildForm

 /**
  *
  * {@inheritdoc}
  *
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     /** @var FieldType $fieldType */
     $fieldType = $builder->getOptions()['metadata'];
     $attr = ['class' => 'timepicker', 'data-show-meridian' => $options['showMeridian'] ? 'true' : 'false', 'data-default-time' => $options['defaultTime'], 'data-show-seconds' => $options['showSeconds'], 'data-explicit-mode' => $options['explicitMode']];
     if ($options['minuteStep']) {
         $attr['data-minute-step'] = $options['minuteStep'];
     }
     $builder->add('data_value', TextType::class, ['label' => isset($options['label']) ? $options['label'] : $fieldType->getName(), 'disabled' => !$this->authorizationChecker->isGranted($fieldType->getMinimumRole()), 'required' => false, 'attr' => $attr]);
 }
开发者ID:theus77,项目名称:ElasticMS,代码行数:15,代码来源:TimeFieldType.php

示例8: buildForm

 /**
  *
  * {@inheritdoc}
  *
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     /** @var FieldType $fieldType */
     $fieldType = $builder->getOptions()['metadata'];
     $builder->add('data_value', IconTextType::class, ['label' => null != $options['label'] ? $options['label'] : $fieldType->getName(), 'required' => false, 'disabled' => !$this->authorizationChecker->isGranted($fieldType->getMinimumRole()), 'icon' => $options['icon'], 'attr' => ['class' => 'ems_daterangepicker', 'data-display-option' => json_encode($fieldType->getDisplayOptions())]]);
 }
开发者ID:theus77,项目名称:ElasticMS,代码行数:11,代码来源:DateRangeFieldType.php

示例9: buildForm

 /**
  *
  * {@inheritdoc}
  *
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     /** @var FieldType $fieldType */
     $fieldType = $builder->getOptions()['metadata'];
     $builder->add('data_value', TextType::class, ['label' => isset($options['label']) ? $options['label'] : $fieldType->getName(), 'required' => false, 'disabled' => !$this->authorizationChecker->isGranted($fieldType->getMinimumRole()), 'attr' => ['class' => 'datepicker', 'data-date-format' => $fieldType->getDisplayOptions()['displayFormat'], 'data-today-highlight' => $fieldType->getDisplayOptions()['todayHighlight'], 'data-week-start' => $fieldType->getDisplayOptions()['weekStart'], 'data-days-of-week-highlighted' => $fieldType->getDisplayOptions()['daysOfWeekHighlighted'], 'data-days-of-week-disabled' => $fieldType->getDisplayOptions()['daysOfWeekDisabled'], 'data-multidate' => $fieldType->getDisplayOptions()['multidate'] ? "true" : "false"]]);
 }
开发者ID:theus77,项目名称:ElasticMS,代码行数:11,代码来源:DateFieldType.php

示例10: buildForm

 /**
  *
  * @param FormBuilderInterface $builder        	
  * @param array $options        	
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     /** @var FieldType $fieldType */
     $fieldType = $builder->getOptions()['metadata'];
     $builder->add('text_value', TextareaSymfonyType::class, ['attr' => ['class' => 'ckeditor_ems', 'data-height' => $options['height']], 'label' => $options['label'], 'required' => false, 'disabled' => !$this->authorizationChecker->isGranted($fieldType->getMinimumRole())]);
 }
开发者ID:theus77,项目名称:ElasticMS,代码行数:11,代码来源:WysiwygFieldType.php


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