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


PHP FormBuilderInterface::getAttribute方法代码示例

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


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

示例1: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     if (null !== ($prototypeFormBuilder = $builder->getAttribute('prototype'))) {
         /** @var $prototypeFormBuilder FormBuilderInterface */
         $prototypeFormBuilder->setData($options['prototype_data']);
     }
 }
开发者ID:miguelplazasr,项目名称:sec,代码行数:10,代码来源:CollectionTypeExtension.php

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

示例3: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $attr = $builder->getAttribute('sonata_admin');
     if (isset($attr['class'])) {
         $attr['class'] .= ' money';
         $builder->setAttribute('sonata_admin', $attr);
     }
     $builder->addViewTransformer(new MoneyToLocalizedStringTransformer($options['precision'], $options['grouping'], null, $options['divisor']));
 }
开发者ID:defan-marunchak,项目名称:eurotax,代码行数:12,代码来源:MoneyType.php

示例4: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $attr = $builder->getAttribute('sonata_admin');
     if (isset($attr['class'])) {
         $attr['class'] .= ' percent';
         $builder->setAttribute('sonata_admin', $attr);
     }
     $builder->addViewTransformer(new PercentToLocalizedStringTransformer($options['precision'], $options['type']));
 }
开发者ID:defan-marunchak,项目名称:eurotax,代码行数:12,代码来源:PercentType.php

示例5: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $attr = $builder->getAttribute('sonata_admin');
     if (isset($attr['class'])) {
         $attr['class'] .= ' number';
         $builder->setAttribute('sonata_admin', $attr);
     }
     $builder->addViewTransformer(new NumberToLocalizedStringTransformer($options['precision'], $options['grouping'], $options['rounding_mode']));
 }
开发者ID:defan-marunchak,项目名称:eurotax,代码行数:12,代码来源:NumberType.php

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

示例7: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->setAttribute('include_variants', $options['include_variants']);
     $builder->add('inventoryItems', InventoryItemCollectionType::NAME);
     if ($builder->getAttribute('include_variants')) {
         $builder->add('variant', VariantInventoryType::NAME);
     }
     $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
         /** @var Product $data */
         $data = $event->getData();
         /*
          * If product has variant, product itself is removed from collection of variant products.
          */
         if ($data && ($variant = $data->getVariant())) {
             $variant->getProducts()->removeElement($data);
         }
     });
 }
开发者ID:umpirsky,项目名称:marello,代码行数:21,代码来源:ProductInventoryType.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']);
         $configs = $this->container->getParameter('bootstrapp.ckeditor.configs');
         $config = $options['config'];
         $configName = $options['config_name'];
         if (null === $configName) {
             $configName = uniqid('bootstrapp', true);
         }
         if (array_key_exists($configName, $config)) {
             $configs[$configName] = array_merge($configs[$configName], $config);
         } else {
             $configs[$configName] = $config;
         }
         $builder->setAttribute('config', $configs[$configName]);
         $builder->setAttribute('plugins', $options['plugins']);
     }
 }
开发者ID:nmariani,项目名称:bootstrapp-bundle,代码行数:23,代码来源:CKEditorType.php

示例9: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->setAttribute('enable', $options['enable']);
     if ($builder->getAttribute('enable')) {
         $builder->setAttribute('autoload', $options['autoload']);
         $builder->setAttribute('inline', $options['inline']);
         $builder->setAttribute('jquery', $options['jquery']);
         $builder->setAttribute('input_sync', $options['input_sync']);
         $builder->setAttribute('base_path', $options['base_path']);
         $builder->setAttribute('js_path', $options['js_path']);
         $builder->setAttribute('jquery_path', $options['jquery_path']);
         $configManager = clone $this->configManager;
         $pluginManager = clone $this->pluginManager;
         $stylesSetManager = clone $this->stylesSetManager;
         $templateManager = clone $this->templateManager;
         $config = $options['config'];
         if ($options['config_name'] === null) {
             $options['config_name'] = uniqid('ivory', true);
             $configManager->setConfig($options['config_name'], $config);
         } else {
             $configManager->mergeConfig($options['config_name'], $config);
         }
         $pluginManager->setPlugins($options['plugins']);
         $stylesSetManager->setStylesSets($options['styles']);
         $templateManager->setTemplates($options['templates']);
         $builder->setAttribute('config', $configManager->getConfig($options['config_name']));
         $builder->setAttribute('plugins', $pluginManager->getPlugins());
         $builder->setAttribute('styles', $stylesSetManager->getStylesSets());
         $builder->setAttribute('templates', $templateManager->getTemplates());
     }
 }
开发者ID:surajkrpaul13,项目名称:IvoryCKEditorBundle,代码行数:34,代码来源:CKEditorType.php

示例10: 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']);
         $config = $options['config'];
         if ($options['config_name'] === null) {
             $name = uniqid('ivory', true);
             $options['config_name'] = $name;
             $this->configManager->setConfig($name, $config);
         } else {
             $this->configManager->mergeConfig($options['config_name'], $config);
         }
         $this->pluginManager->setPlugins($options['plugins']);
         $this->stylesSetManager->setStylesSets($options['styles']);
         $this->templateManager->setTemplates($options['templates']);
         $builder->setAttribute('config', $this->configManager->getConfig($options['config_name']));
         $builder->setAttribute('plugins', $this->pluginManager->getPlugins());
         $builder->setAttribute('styles', $this->stylesSetManager->getStylesSets());
         $builder->setAttribute('templates', $this->templateManager->getTemplates());
     }
 }
开发者ID:jul6art,项目名称:vscms,代码行数:26,代码来源:CKEditorType.php

示例11: getUserAwareChoiceBuilder

 /**
  * @param FormBuilderInterface $builder
  * @param UserInterface|null   $user
  *
  * @return callable
  */
 public static function getUserAwareChoiceBuilder(FormBuilderInterface $builder, UserInterface $user = null)
 {
     return function (EntityRepository $objectRepository) use($builder, $user) {
         return $objectRepository->createQueryBuilder('o')->andWhere('o.user = :user')->setParameter('user', $user ?: $builder->getAttribute('user_aware'));
     };
 }
开发者ID:liverbool,项目名称:dos-resource-bundle,代码行数:12,代码来源:Factory.php


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