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