當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。