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


PHP FormBuilderInterface::appendClientTransformer方法代码示例

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


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

示例1: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if (!$options['choice_list']) {
         $options['choice_list'] = new AjaxArrayChoiceList($options['choices'], $options['ajax']);
     }
     $builder->appendClientTransformer(new ChoiceToJsonTransformer($options['choice_list'], $options['widget'], $options['multiple'], $options['ajax'], $options['freeValues']))->setAttribute('choice_list', $options['choice_list'])->setAttribute('widget', $options['widget'])->setAttribute('route_name', $options['route_name'])->setAttribute('freeValues', $options['freeValues']);
 }
开发者ID:r4cker,项目名称:GenemuFormBundle,代码行数:10,代码来源:AutocompleterType.php

示例2: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $delivery_addresses = array();
     foreach ($this->user->getDeliveryAddresses() as $add) {
         $delivery_addresses[$add->getId()] = $add->getFullAddress();
     }
     if (!empty($delivery_addresses)) {
         $delivery_addresses['create_new'] = 'Создать новый';
         $builder->add('exist', 'choice', array('choices' => $delivery_addresses, 'required' => false, 'expanded' => true));
     }
     $builder->add('new', 'delivery_address', array('required' => false));
     $transformer = new OrderDeliveryAddressTransformer($this->om, $this->user);
     $builder->appendClientTransformer($transformer);
 }
开发者ID:hd-deman,项目名称:Chewbacca,代码行数:14,代码来源:OrderDeliveryAddressType.php

示例3: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $phones = array();
     foreach ($this->user->getPhoneNumbers() as $phone) {
         $phones[$phone->getId()] = $phone->getPhoneNumber();
     }
     if (!empty($phones)) {
         $phones['create_new'] = 'Создать новый';
         $builder->add('exist', 'choice', array('choices' => $phones, 'required' => false, 'expanded' => true));
     }
     $builder->add('new', 'user_phone', array('required' => false));
     $transformer = new OrderUserPhoneTransformer($this->om, $this->user);
     $builder->appendClientTransformer($transformer);
 }
开发者ID:hd-deman,项目名称:Chewbacca,代码行数:14,代码来源:OrderUserPhoneType.php

示例4: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if (true === empty($options['choice_list'])) {
         $options['choice_list'] = new AjaxArrayChoiceList($options['choices'], $options['ajax']);
     }
     if (isset($options['tokenLimit']) && is_numeric($options['tokenLimit']) && $options['tokenLimit'] > 0) {
         $options['multiple'] = 1 != $options['tokenLimit'];
     }
     if (!$options['multiple']) {
         $options['tokenLimit'] = 1;
     }
     $builder->appendClientTransformer(new ChoiceToJsonTransformer($options['choice_list'], $options['widget'], $options['multiple'], $options['ajax']))->setAttribute('choice_list', $options['choice_list'])->setAttribute('widget', $options['widget'])->setAttribute('route_name', $options['route_name']);
     foreach ($this->_availableTokeninputOptions as $option) {
         if (isset($options[$option])) {
             $builder->setAttribute($option, $options[$option]);
         }
     }
 }
开发者ID:r4cker,项目名称:GenemuFormBundle,代码行数:21,代码来源:TokeninputType.php

示例5: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if (!isset($options['default'])) {
         if ($options['required']) {
             $dateRange = new DateRange($this->date_format);
             $dateRange->createToDate(new \DateTime(), $this->default_interval);
         } else {
             $dateRange = null;
         }
     } else {
         $dateRange = $options['default'];
     }
     $options['default'] = $dateRange;
     $builder->appendClientTransformer(new DateRangeToValueTransformer($this->date_format));
     $builder->setData($options['default']);
     // Datepicker date format
     $searches = array('d', 'm', 'y', 'Y');
     $replaces = array('dd', 'mm', 'yy', 'yyyy');
     $datepicker_format = str_replace($searches, $replaces, $this->date_format);
     $builder->setAttribute('datepicker_date_format', $datepicker_format);
 }
开发者ID:nucleartux,项目名称:ShtumiUsefulBundle1,代码行数:21,代码来源:DateRangeType.php

示例6: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->appendClientTransformer(new EntityToStringTransformer());
 }
开发者ID:sgh1986915,项目名称:symfony-tsk,代码行数:4,代码来源:FactValueType.php


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