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


PHP FormBuilderInterface::prependClientTransformer方法代码示例

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


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

示例1: buildForm

 /**
  * {@inheritDoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if ($options['multiple']) {
         $builder->addEventSubscriber(new MergeCollectionListener($options['model_manager']))->prependClientTransformer(new ModelsToArrayTransformer($options['choice_list']));
     } else {
         $builder->prependClientTransformer(new ModelToIdTransformer($options['model_manager'], $options['class']));
     }
 }
开发者ID:novatex,项目名称:SonataAdminBundle,代码行数:11,代码来源:ModelType.php

示例2: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->prependClientTransformer(new CategoriesCollectionTransformer($options['entityCategoryClass']))->addEventSubscriber(new CategoriesMergeCollectionListener());
     $registries = \CategoryRegistryUtil::getRegisteredModuleCategories($options['module'], $options['entity'], 'id');
     foreach ($registries as $registryId => $categoryId) {
         $builder->add('registry_' . $registryId, 'entity', array('class' => 'ZikulaCategoriesModule:CategoryEntity', 'property' => 'name', 'query_builder' => function (EntityRepository $repo) use($categoryId) {
             //TODO: (move to)/use own entity repository after CategoryUtil migration
             return $repo->createQueryBuilder('e')->where('e.parent = :parentId')->setParameter('parentId', (int) $categoryId);
         }));
     }
 }
开发者ID:rmaiwald,项目名称:core,代码行数:11,代码来源:CategoriesType.php

示例3: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $entities = $this->container->getParameter('shtumi.dependent_filtered_entities');
     $options['class'] = $entities[$options['entity_alias']]['class'];
     $options['property'] = $entities[$options['entity_alias']]['property'];
     $options['no_result_msg'] = $entities[$options['entity_alias']]['no_result_msg'];
     $builder->prependClientTransformer(new EntityToIdTransformer($this->container->get('doctrine')->getEntityManager(), $options['class']));
     $builder->setAttribute("parent_field", $options['parent_field']);
     $builder->setAttribute("entity_alias", $options['entity_alias']);
     $builder->setAttribute("no_result_msg", $options['no_result_msg']);
     $builder->setAttribute("empty_value", $options['empty_value']);
 }
开发者ID:nucleartux,项目名称:ShtumiUsefulBundle1,代码行数:12,代码来源:DependentFilteredEntityType.php

示例4: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $entities = $this->container->getParameter('shtumi.autocomplete_entities');
     if (null === $options['entity_alias']) {
         throw new FormException('You must provide a entity alias "entity_alias" and tune it in config file');
     }
     if (!isset($entities[$options['entity_alias']])) {
         throw new FormException('There are no entity alias "' . $options['entity_alias'] . '" in your config file');
     }
     $options['class'] = $entities[$options['entity_alias']]['class'];
     $options['property'] = $entities[$options['entity_alias']]['property'];
     $builder->prependClientTransformer(new EntityToPropertyTransformer($this->container->get('doctrine')->getEntityManager(), $options['class'], $options['property']));
     $builder->setAttribute('entity_alias', $options['entity_alias']);
 }
开发者ID:nucleartux,项目名称:ShtumiUsefulBundle1,代码行数:14,代码来源:AjaxAutocompleteType.php

示例5: buildForm

 /**
  * {@inheritDoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->prependClientTransformer(new ModelToIdTransformer($options['model_manager'], $options['class']));
 }
开发者ID:novatex,项目名称:SonataAdminBundle,代码行数:7,代码来源:ModelReferenceType.php

示例6: buildForm

 /**
  * Builds the form.
  *
  * @param FormBuilderInterface $builder The form builder
  * @param array                $options The options
  *
  * @return void
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->prependClientTransformer(new EntitiesToStringTransformer($this->registry->getEntityManager()));
 }
开发者ID:johnpancoast,项目名称:BlogBundle,代码行数:12,代码来源:TagsType.php

示例7: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if ($options['multiple']) {
         $builder->prependClientTransformer(new CollectionToArrayTransformer());
     }
 }
开发者ID:redpanda,项目名称:symfony,代码行数:6,代码来源:ModelType.php

示例8: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(Form\FormBuilderInterface $builder, array $options)
 {
     $builder->prependClientTransformer($this->dataTransformer)->add('id', 'hidden')->add('name', 'text', array('property_path' => null, 'cascade_validation' => false));
 }
开发者ID:roomthirteen,项目名称:Room13GeoBundle,代码行数:7,代码来源:LocationFieldType.php


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