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


PHP FormMapper::add方法代码示例

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


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

示例1: configureFormFields

 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->add('bg', 'text', array("label" => "Fichier", 'required' => false));
     $formMapper->add('name', 'text', array("label" => "Nom de Fichier"));
     $formMapper->add('pdf', 'text', array("label" => "Fichier Pdf"));
     $formMapper->add('parameters', 'sonata_type_collection', array('by_reference' => false), array('edit' => 'inline', 'inline' => 'table', 'sortable' => 'position'));
 }
开发者ID:saliih,项目名称:yasmine-print,代码行数:7,代码来源:TplprodAdmin.php

示例2: configureFormFields

 /**
  * @param \Sonata\AdminBundle\Form\FormMapper $formMapper
  * @return void
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     if (!$this->isChild()) {
         $formMapper->add('post', 'sonata_type_model', array(), array('edit' => 'list'));
         //            $formMapper->add('post', 'sonata_type_admin', array(), array('edit' => 'inline'));
     }
     $formMapper->add('name')->add('email')->add('url', null, array('required' => false))->add('message')->add('status', 'choice', array('choices' => Comment::getStatusList(), 'expanded' => true, 'multiple' => false));
 }
开发者ID:roelveldhuizen,项目名称:SonataNewsBundle,代码行数:12,代码来源:CommentAdmin.php

示例3: configureFormFields

 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->add('name')->add('width')->add('length')->add('height');
     if ($this->getSubject() && !is_null($this->getSubject()->getId())) {
         $formMapper->add('furnitures', 'sonata_type_collection', array('by_reference' => false, 'type_options' => array('delete' => false, 'delete_options' => array('type' => 'hidden', 'type_options' => array('mapped' => false, 'required' => false)))), array('edit' => 'inline', 'inline' => 'table', 'sortable' => 'position'));
     }
 }
开发者ID:stef76,项目名称:SymfonyStarter,代码行数:10,代码来源:RoomAdmin.php

示例4: configureFormFields

 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->add('enabled', null, array('required' => false))->add('name')->add('description', 'textarea', array('required' => false))->add('position', 'integer', array('required' => false, 'data' => 0))->add('parent', 'sonata_category_selector', array('category' => $this->getSubject() ?: null, 'model_manager' => $this->getModelManager(), 'class' => $this->getClass(), 'required' => false));
     if (interface_exists('Sonata\\MediaBundle\\Model\\MediaInterface')) {
         $formMapper->add('media', 'sonata_type_model_list', array('required' => false), array('link_parameters' => array('provider' => 'sonata.media.provider.image', 'context' => 'sonata_category')));
     }
 }
开发者ID:BookWorld1,项目名称:nom,代码行数:10,代码来源:CategoryAdmin.php

示例5: configureFormFields

 protected function configureFormFields(FormMapper $formMapper)
 {
     if ($this->getRequest()->get('_sonata_admin') == 'sonata.admin.indicador_alertas') {
         $formMapper->add('indicador', null, array('label' => $this->getTranslator()->trans('indicador')));
     }
     $formMapper->add('limiteInferior', null, array('label' => $this->getTranslator()->trans('_alerta_limite_inferior_'), 'required' => true))->add('limiteSuperior', null, array('label' => $this->getTranslator()->trans('limite_superior'), 'required' => true))->add('color', null, array('label' => $this->getTranslator()->trans('color'), 'required' => true))->add('comentario', null, array('label' => $this->getTranslator()->trans('comentario')));
 }
开发者ID:CrisMenjivar,项目名称:TesisSIIGv1,代码行数:7,代码来源:IndicadorAlertasAdmin.php

示例6: configureFormFields

 protected function configureFormFields(FormMapper $formMapper)
 {
     if (!$this->isChild()) {
         $formMapper->add('employee', 'sonata_type_model', array('btn_add' => false));
     }
     $formMapper->add('startDate', null, array('widget' => 'single_text'))->add('endDate', 'date', array('widget' => 'single_text'));
 }
开发者ID:Nexotap,项目名称:Ivory,代码行数:7,代码来源:PayrollAdmin.php

示例7: configureFormFields

 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->add('name', 'text', array("label" => "Template"));
     $formMapper->add('file', 'file', array("label" => "fichier AI", 'required' => false, 'data_class' => null));
     $formMapper->add('width', 'number', array("label" => "largeur"));
     $formMapper->add('height', 'number', array("label" => "hauteur"));
 }
开发者ID:saliih,项目名称:yasmine-print,代码行数:7,代码来源:TemplateAdmin.php

示例8: configureFormFields

 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->add('name')->add('description', 'textarea', array('required' => false))->add('context')->add('enabled', null, array('required' => false));
     if (interface_exists('Sonata\\MediaBundle\\Model\\MediaInterface')) {
         $formMapper->add('media', 'sonata_type_model_list', array('required' => false), array('link_parameters' => array('provider' => 'sonata.media.provider.image', 'context' => 'sonata_collection')));
     }
 }
开发者ID:kazak,项目名称:forum,代码行数:10,代码来源:CollectionAdmin.php

示例9: buildCreateForm

 /**
  * {@inheritdoc}
  */
 public function buildCreateForm(FormMapper $formMapper)
 {
     $formMapper->add('name', null, array('required' => false));
     $formMapper->add('description');
     $formMapper->add('copyright');
     $formMapper->add('binaryContent', 'file', array('constraints' => array(new NotBlank(), new NotNull())));
 }
开发者ID:symbio,项目名称:orangegate4-media-bundle,代码行数:10,代码来源:FileProvider.php

示例10: configureFormFields

 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     if (!$this->hasParentFieldDescription()) {
         $formMapper->add('car', null, array('constraints' => new Assert\NotNull()));
     }
     $formMapper->add('date', null, array('widget' => 'single_text'))->add('comment');
 }
开发者ID:saberyounis,项目名称:Sonata-Project,代码行数:10,代码来源:InspectionAdmin.php

示例11: configureFormFields

 /**
  * {@inheritdoc}
  */
 public function configureFormFields(FormMapper $formMapper)
 {
     if (!$this->isChild()) {
         $formMapper->add('product', 'sonata_type_model_list', array(), array('admin_code' => 'sonata.product.admin.product'));
     }
     $formMapper->add('category')->add('main')->add('enabled');
 }
开发者ID:lzdv,项目名称:ecommerce,代码行数:10,代码来源:ProductCategoryAdmin.php

示例12: configureFormFields

 /**
  * Конфигурем форму редактирования
  *
  * @param FormMapper $formMapper
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     if ($this->useModel()) {
         $formMapper->add('Model', 'text', array('disabled' => true, 'required' => false))->add('ObjectId', 'text', array('disabled' => true, 'required' => false))->add('Locale', 'choice', array('label' => 'Локаль', 'required' => false, 'choices' => $this->getLocaleChoices(), 'empty_data' => false));
     }
     $formMapper->add('OldUrl', 'text', array('label' => 'Старый адрес'))->add('NewUrl', 'text', array('label' => 'Новый адрес', 'required' => false));
 }
开发者ID:it-blaster,项目名称:redirect-bundle,代码行数:12,代码来源:RedirectAdmin.php

示例13: configureFormFields

 /**
  * @param \Sonata\AdminBundle\Form\FormMapper $formMapper
  */
 public function configureFormFields(FormMapper $formMapper)
 {
     if (!$this->isChild()) {
         $formMapper->add('product', 'sonata_type_model_list', array(), array('admin_code' => 'sonata.product.admin.product'));
     }
     $formMapper->add('enabled')->add('code', 'sonata_delivery_choice')->add('perItem')->add('countryCode', 'country')->add('zone');
 }
开发者ID:sonata-project,项目名称:ecommerce,代码行数:10,代码来源:DeliveryAdmin.php

示例14: configureFormFields

 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->add('type', 'entity', array('class' => 'AppBundle\\Entity\\JamType', 'property' => 'name'));
     $formMapper->add('year', 'entity', array('class' => 'AppBundle\\Entity\\JamYear', 'property' => 'year'));
     $formMapper->add('comment', 'text', array('required' => false));
     $formMapper->add('amount', 'number', array('mapped' => false, 'data' => 1));
 }
开发者ID:colinbleach,项目名称:JamJar,代码行数:7,代码来源:JamJarAdmin.php

示例15: buildForm

 public function buildForm(AdminInterface $admin, FormMapper $formMapper)
 {
     /**
      * Bind data to the mapped fields
      */
     $formMapper->getFormBuilder()->addEventListener(FormEvents::POST_SET_DATA, function (FormEvent $formEvent) {
         $data = $formEvent->getData();
         $form = $formEvent->getForm();
         if ($data instanceof Route) {
             $form->get('source')->setData($data->getPath());
             $form->get('target')->setData($data->getDefault('path'));
         }
     });
     /**
      * Bind the mapped fields to the entity
      */
     $formMapper->getFormBuilder()->addEventListener(FormEvents::SUBMIT, function (FormEvent $formEvent) {
         $data = $formEvent->getData();
         $form = $formEvent->getForm();
         if ($data instanceof Route) {
             $data->setStaticPrefix($form->get('source')->getData());
             $data->setDefault('path', $form->get('target')->getData());
             $data->setDefault('_controller', $this->routeController);
             $data->setDefault('permanent', true);
         }
     });
     $formMapper->add('source', 'text', ['mapped' => false]);
     $formMapper->add('target', 'text', ['mapped' => false]);
     $formMapper->remove('staticPrefix');
     $formMapper->remove('variablePattern');
 }
开发者ID:gravity-cms,项目名称:cms-bundle,代码行数:31,代码来源:RedirectType.php


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