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


PHP FormBuilderInterface::setAttribute方法代码示例

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


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

示例1: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->setAttribute('base_path', $options['base_path']);
     $builder->setAttribute('css_path', $options['css_path']);
     $builder->setAttribute('js_path', $options['js_path']);
     $builder->setAttribute('config', $options['config']);
 }
开发者ID:aulasoftwarelibre,项目名称:seta,代码行数:7,代码来源:BsDateTimeType.php

示例2: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->addViewTransformer(new ModelToIdTransformer($options['model_manager'], $options['class']), true);
     $builder->setAttribute('root_node', $options['root_node']);
     $builder->setAttribute('select_root_node', $options['select_root_node']);
     $builder->setAttribute('repository_name', $options['repository_name']);
 }
开发者ID:jmontoyaa,项目名称:SonataDoctrinePhpcrAdminBundle,代码行数:10,代码来源:TreeModelType.php

示例3: buildForm

 /**
  * @param FormBuilderInterface $builder
  * @param array                $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->setAttribute('group_enabled', $options['group_enabled']);
     $builder->setAttribute('group_id', $options['group_id']);
     $builder->setAttribute('sub_group_id', $options['sub_group_id']);
     $builder->setAttribute('group_render', $options['group_render']);
     $builder->setAttribute('sub_group_render', $options['sub_group_render']);
 }
开发者ID:open-orchestra,项目名称:open-orchestra-cms-bundle,代码行数:12,代码来源:FormTypeGroupExtension.php

示例4: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->setAttribute('enable', $options['enable']);
     if ($builder->getAttribute('enable')) {
         $builder->setAttribute('instance', $options['instance']);
     }
     $builder->setAttribute('homeFolder', $options['homeFolder']);
 }
开发者ID:jstnthms,项目名称:FMElfinderBundle,代码行数:11,代码来源:ElFinderType.php

示例5: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if (!empty($options['invalid_message'])) {
         $builder->setAttribute('invalid_message', $options['invalid_message']);
     }
     if (!empty($options['invalid_message_parameters'])) {
         $builder->setAttribute('invalid_message_parameters', $options['invalid_message_parameters']);
     }
 }
开发者ID:ismailbaskin,项目名称:APYJsFormValidationBundle,代码行数:9,代码来源:RepeatedTypeExtension.php

示例6: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if (null !== $options['apply_filter']) {
         $builder->setAttribute('apply_filter', $options['apply_filter']);
     }
     if ($options['filter_condition_builder'] instanceof \Closure) {
         $builder->setAttribute('filter_condition_builder', $options['filter_condition_builder']);
     }
 }
开发者ID:11ya,项目名称:LexikFormFilterBundle,代码行数:12,代码来源:FilterTypeExtension.php

示例7: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if ($options['apply_filter'] instanceof \Closure || is_callable($options['apply_filter']) || is_string($options['apply_filter'])) {
         $builder->setAttribute('apply_filter', $options['apply_filter']);
     }
     if ($options['filter_condition_builder'] instanceof \Closure) {
         $builder->setAttribute('filter_condition_builder', $options['filter_condition_builder']);
     }
 }
开发者ID:sureinstein,项目名称:spiderman,代码行数:12,代码来源:FilterTypeExtension.php

示例8: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->setAttribute('enable', $options['enable']);
     if ($builder->getAttribute('enable')) {
         $builder->setAttribute('base_path', $options['base_path']);
         $builder->setAttribute('js_path', $options['js_path']);
         $builder->setAttribute('inline', $options['inline']);
         $builder->setAttribute('instance', $options['instance']);
     }
 }
开发者ID:helios-ag,项目名称:FMTinyMCEBundle,代码行数:13,代码来源:TinyMCEType.php

示例9: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if (null === $options['class']) {
         throw new InvalidConfigurationException('Option "class" is empty');
     }
     if (null === $options['parent_field']) {
         throw new InvalidConfigurationException('Option "parent_field" is empty');
     }
     if (null === $options['property']) {
         throw new InvalidConfigurationException('Option "property" is empty');
     }
     $builder->addViewTransformer(new EntityToIdTransformer($this->em, $options['class']), true);
     $query = $options['query'];
     if ($query instanceof \Closure) {
         $queryBuilder = $query($this->em->getRepository($options['class']));
         $query = $queryBuilder->getQuery()->getDql();
     }
     $builder->setAttribute('class', $options['class']);
     $builder->setAttribute("parent_field", $options['parent_field']);
     $builder->setAttribute("no_result_msg", $options['no_result_msg']);
     $builder->setAttribute("empty_value", $options['empty_value']);
     $builder->setAttribute("property", $options['property']);
     $builder->setAttribute("em_name", $options['em_name']);
     $builder->setAttribute('query', $query);
     $builder->setAttribute("order_direction", $options['order_direction']);
     $builder->setAttribute("order_property", $options['order_property']);
 }
开发者ID:zk2,项目名称:useful-bundle,代码行数:27,代码来源:DependentEntityType.php

示例10: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if ($options['allow_add'] && $options['prototype']) {
         $prototype = $builder->create($options['prototype_name'], $options['type'], array_replace(array('label' => $options['prototype_name'] . 'label__'), $options['options']));
         $builder->setAttribute('prototype', $prototype->getForm());
     }
     if ($options['class_container']) {
         $builder->setAttribute('class_container', $options['class_container']);
     }
     $resizeListener = new ResizeFormListener($options['type'], $options['options'], $options['allow_add'], $options['class_container'], $options['allow_delete']);
     $builder->addEventSubscriber($resizeListener);
 }
开发者ID:blab2015,项目名称:seh,代码行数:15,代码来源:CollectionCustomType.php

示例11: buildForm

 /**
  * @param FormBuilderInterface $builder
  * @param array                $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('label', 'text', array('label' => 'open_orchestra_backoffice.form.block.label', 'constraints' => new NotBlank(), 'group_id' => 'property', 'sub_group_id' => 'property'));
     $builder->add('style', 'choice', array('label' => 'open_orchestra_backoffice.form.block.style', 'required' => false, 'choices' => $this->getStyleChoices(), 'group_id' => 'property', 'sub_group_id' => 'style'));
     $builder->add('maxAge', 'integer', array('label' => 'open_orchestra_backoffice.form.block.max_age', 'required' => false, 'group_id' => 'technical', 'sub_group_id' => 'cache'));
     $builder->setAttribute('template', $this->generateFormManager->getTemplate($options['data']));
     $builder->addViewTransformer($this->blockToArrayTransformer);
     $builder->addEventSubscriber($this->blockFormTypeSubscriber);
     if (array_key_exists('disabled', $options)) {
         $builder->setAttribute('disabled', $options['disabled']);
     }
 }
开发者ID:open-orchestra,项目名称:open-orchestra-cms-bundle,代码行数:16,代码来源:BlockType.php

示例12: buildForm

 /**
  * {@inheritdoc}
  *
  * @see Symfony\Component\Form.AbstractTypeExtension::buildForm()
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $dataClass = $builder->getDataClass();
     $subscriber = new AddIdentifierSubscriber($builder->getFormFactory(), $this->getJsfv());
     $builder->addEventSubscriber($subscriber);
     if (!empty($options['validation_groups'])) {
         $builder->setAttribute('validation_groups', $options['validation_groups']);
     }
     if ($dataClass !== null) {
         $builder->setAttribute('data_class', $dataClass);
     }
 }
开发者ID:ismailbaskin,项目名称:APYJsFormValidationBundle,代码行数:17,代码来源:FormTypeExtension.php

示例13: buildForm

 /**
  * Builds the form.
  *
  * This method is called for each type in the hierarchy starting form the
  * top most type. Type extensions can further modify the form.
  *
  * @param FormBuilderInterface $builder The form builder
  * @param array                $options The options
  *
  * @see FormTypeExtensionInterface::buildForm()
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if (!$options['loader']) {
         $loader = $this->iconFontManager->getDefaultLoader();
     } else {
         $loader = $this->iconFontManager->getLoader($options['loader']);
     }
     $loader->setData($options['loader_data']);
     $builder->setAttribute('loader', $options['loader']);
     $builder->setAttribute('loader_object', $loader);
     $builder->setAttribute('loader_data', $options['loader_data']);
 }
开发者ID:axelvnk,项目名称:KunstmaanBundlesCMS,代码行数:23,代码来源:IconFontType.php

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

示例15: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $options['pref_options']['required'] = $options['required'];
     $options['addr01_options']['required'] = $options['required'];
     $options['addr02_options']['required'] = $options['required'];
     if (!isset($options['options']['error_bubbling'])) {
         $options['options']['error_bubbling'] = $options['error_bubbling'];
     }
     $builder->add($options['pref_name'], 'pref', array_merge($options['options'], $options['pref_options']))->add($options['addr01_name'], 'text', array_merge($options['options'], $options['addr01_options']))->add($options['addr02_name'], 'text', array_merge($options['options'], $options['addr02_options']))->addEventSubscriber(new \Eccube\Event\FormEventSubscriber());
     $builder->setAttribute('pref_name', $options['pref_name']);
     $builder->setAttribute('addr01_name', $options['addr01_name']);
     $builder->setAttribute('addr02_name', $options['addr02_name']);
 }
开发者ID:noadless,项目名称:ec-cube,代码行数:16,代码来源:AddressType.php


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