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


PHP FormMapper::setHelps方法代码示例

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


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

示例1: configureFormFields

 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     // define group zoning
     $formMapper->with($this->trans('form_dashboard.group_main_label'), array('class' => 'col-md-12'))->end();
     $formMapper->with($this->trans('form_dashboard.group_main_label'))->add('name')->add('enabled', null, array('required' => false))->end();
     $formMapper->setHelps(array('name' => $this->trans('help_dashboard_name')));
 }
开发者ID:Wharenn,项目名称:SonataDashboardBundle,代码行数:10,代码来源:DashboardAdmin.php

示例2: configureFormFieldsAttributes

 function configureFormFieldsAttributes(FormMapper $formMapper)
 {
     $formMapper->with('Attributes', array('class' => 'col-md-4'))->add('enabled', null, array('required' => false, 'label' => 'Show content on website'))->add('date', 'sonata_type_datetime_picker', ['required' => false, 'format' => 'dd.MM.yyyy H:mm', 'datepicker_use_button' => false])->end();
     if ($this->subject && $this->subject->getRubric()) {
         $url = $this->configurationPool->getContainer()->get('iphp.core.entity.router')->entitySiteUrl($this->subject);
         $formMapper->setHelps(['enabled' => '<a target="_blank" href="' . $url . '">' . $url . '</a>']);
     }
 }
开发者ID:mikemadisonweb,项目名称:IphpContentBundle,代码行数:8,代码来源:ContentAdmin.php

示例3: configureFormFields

 protected function configureFormFields(FormMapper $form)
 {
     $form->with('Page')->add('title')->add('content', 'ckeditor', ['config_name' => 'page'])->end();
     if ($this->getSubject()) {
         $form->with('Route')->add('slug', null, ['required' => false])->end();
     }
     $form->with('SEO')->add('seoMetaData', 'sonata_type_model_list', ['required' => false])->end();
     $form->setHelps(['slug' => "If you leave empty it will be automatically created from the page title.<br/><br/> <b>Example:</b> <br/> <b>Title</b>: This article <br/> <b>Slug</b>: this-article"]);
 }
开发者ID:ChiarilloMassimo,项目名称:SimpleCMS,代码行数:9,代码来源:Page.php

示例4: configureFormFields

 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with($this->getTranslator()->trans('_datos_generales_'))->add('nombre', null, array('label' => $this->getTranslator()->trans('nombre_indicador')))->add('tema', null, array('label' => $this->getTranslator()->trans('_interpretacion_')))->add('concepto', null, array('label' => $this->getTranslator()->trans('concepto')))->add('unidadMedida', null, array('label' => $this->getTranslator()->trans('unidad_medida')))->add('esAcumulado', null, array('label' => $this->getTranslator()->trans('es_acumulado')))->add('esPublico', null, array('label' => $this->getTranslator()->trans('es_publico')))->add('variables', null, array('label' => $this->getTranslator()->trans('variables'), 'expanded' => true))->add('formula', null, array('label' => $this->getTranslator()->trans('formula'), 'help' => $this->getTranslator()->trans('ayuda_ingreso_formula')))->add('clasificacionUso', null, array('label' => $this->getTranslator()->trans('clasificacion_uso-eTAB')))->add('clasificacionTecnica', null, array('label' => $this->getTranslator()->trans('clasificacion_tecnica'), 'expanded' => true, 'class' => 'IndicadoresBundle:ClasificacionTecnica', 'query_builder' => function ($repository) {
         return $repository->createQueryBuilder('ct')->orderBy('ct.clasificacionUso');
     }))->add('clasificacionPrivacidad', null, array('label' => $this->getTranslator()->trans('_nivel_de_usuario_'), 'expanded' => true))->add('meta', null, array('attr' => array('label' => $this->getTranslator()->trans('meta'), 'min' => '1')))->add('periodo', null, array('label' => $this->getTranslator()->trans('periodicidad')))->add('confiabilidad', null, array('label' => $this->getTranslator()->trans('confiabilidad'), 'required' => false))->add('observacion', 'textarea', array('label' => $this->getTranslator()->trans('_observacion_'), 'required' => false))->end()->with($this->getTranslator()->trans('alertas'))->add('alertas', 'sonata_type_collection', array('label' => $this->getTranslator()->trans('alertas'), 'required' => true), array('class' => 'form-control', 'edit' => 'inline', 'inline' => 'table', 'sortable' => 'position'))->end()->with($this->getTranslator()->trans('_dimensiones_'))->add('camposIndicador', null, array('label' => $this->getTranslator()->trans('campos_indicador')))->end();
     $acciones = explode('/', $this->getRequest()->server->get("REQUEST_URI"));
     $accion = array_pop($acciones);
     if ($accion == 'create') {
         $formMapper->setHelps(array('camposIndicador' => $this->getTranslator()->trans('_debe_guardar_para_ver_dimensiones_')));
     }
 }
开发者ID:SM2015,项目名称:Etab-hibrido,代码行数:11,代码来源:FichaTecnicaAdmin.php

示例5: configureFormFields

 /**
  * @param \Sonata\AdminBundle\Form\FormMapper $formMapper
  * @return void
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $templates = array();
     foreach ($this->cmsManager->getPageManager()->getTemplates() as $code => $template) {
         $templates[$code] = $template->getName();
     }
     if (!$this->getSubject() || !$this->getSubject()->isInternal()) {
         $formMapper->with($this->trans('form_page.group_main_label'))->add('url', 'text', array('attr' => array('readonly' => 'readonly')))->end();
     }
     $formMapper->with($this->trans('form_page.group_main_label'))->add('name')->add('enabled', null, array('required' => false))->add('position')->add('templateCode', 'choice', array('required' => true, 'choices' => $templates))->add('parent', 'sonata_page_selector', array('page' => $this->getSubject() ?: null, 'model_manager' => $this->getModelManager(), 'class' => $this->getClass(), 'filter_choice' => array('hierarchy' => 'root'), 'required' => false))->end();
     if (!$this->getSubject() || !$this->getSubject()->isDynamic()) {
         $formMapper->with($this->trans('form_page.group_main_label'))->add('target', 'sonata_page_selector', array('page' => $this->getSubject() ?: null, 'model_manager' => $this->getModelManager(), 'class' => $this->getClass(), 'filter_choice' => array('request_method' => 'all'), 'required' => false))->end();
     }
     if (!$this->getSubject() || !$this->getSubject()->isHybrid()) {
         $formMapper->with($this->trans('form_page.group_seo_label'))->add('slug', 'text', array('required' => false))->add('customUrl', 'text', array('required' => false))->end();
     }
     $formMapper->with($this->trans('form_page.group_seo_label'), array('collapsed' => true))->add('metaKeyword', 'textarea', array('required' => false))->add('metaDescription', 'textarea', array('required' => false))->end();
     if ($this->hasSubject() && !$this->getSubject()->isCms()) {
         $formMapper->with($this->trans('form_page.group_advanced_label'), array('collapsed' => true))->add('decorate', null, array('required' => false))->end();
     }
     $formMapper->with($this->trans('form_page.group_advanced_label'), array('collapsed' => true))->add('javascript', null, array('required' => false))->add('stylesheet', null, array('required' => false))->add('rawHeaders', null, array('required' => false))->end();
     $formMapper->setHelps(array('name' => $this->trans('help_page_name')));
 }
开发者ID:norfil,项目名称:SonataPageBundle,代码行数:27,代码来源:PageAdmin.php

示例6: configureFormFields

 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     // get site and locales
     $site = null;
     $locales = array();
     if ($this->getSubject()) {
         $site = $this->getSubject()->getSite();
         foreach ($site->getLanguageVersions() as $lv) {
             $locales[] = $lv->getLocale();
         }
     }
     // define group zoning
     $formMapper->with($this->trans('form_page.group_basic_label'), array('class' => 'col-md-6'))->end()->with($this->trans('form_page.group_settings_label'), array('class' => 'col-md-6'))->end()->with($this->trans('form_page.group_advanced_label'), array('class' => 'col-md-6'))->end();
     if (!$this->getSubject() || !$this->getSubject()->isInternal() && !$this->getSubject()->isError()) {
         $formMapper->with($this->trans('form_page.group_basic_label'))->add('translations', 'orangegate_translations', array('label' => false, 'locales' => $locales, 'fields' => array('enabled' => array('field_type' => 'checkbox', 'required' => false), 'name' => array('field_type' => 'text', 'required' => false), 'description' => array('field_type' => 'textarea', 'required' => false), 'slug' => array('field_type' => 'text', 'required' => false), 'url' => array('field_type' => 'text', 'attr' => array('readonly' => 'readonly')), 'title' => array('field_type' => 'text', 'required' => false), 'metaKeyword' => array('field_type' => 'textarea', 'required' => false), 'metaDescription' => array('field_type' => 'textarea', 'required' => false))))->end();
     }
     $formMapper->with($this->trans('form_page.group_settings_label'))->add('templateCode', 'sonata_page_template', array('required' => true))->add('parent', 'orangegate_page_selector', array('page' => $this->getSubject() ?: null, 'site' => $site, 'model_manager' => $this->getModelManager(), 'class' => $this->getClass(), 'required' => !$this->isGranted('EDIT')), array('admin_code' => $this->getCode(), 'link_parameters' => array('siteId' => $site->getId())))->add('icon', 'sonata_type_model_list', array('required' => false), array('placeholder' => 'No image selected', 'link_parameters' => array('context' => 'agrofert', 'provider' => 'sonata.media.provider.image', 'category' => 108, 'hide_context' => true)))->add('position')->add('cssClass')->end();
     /*
             if ($this->hasSubject() && !$this->getSubject()->isInternal()) {
                 $formMapper
                     ->with($this->trans('form_page.group_settings_label'))
                         ->add('type', 'sonata_page_type_choice', array('required' => false))
                     ->end()
                 ;
             }
     
             if (!$this->getSubject() || !$this->getSubject()->isDynamic()) {
                 $formMapper
                     ->with($this->trans('form_page.group_settings_label'))
                         ->add('target', 'sonata_page_selector', array(
                             'page'          => $this->getSubject() ?: null,
                             'site'          => $this->getSubject() ? $this->getSubject()->getSite() : null,
                             'model_manager' => $this->getModelManager(),
                             'class'         => $this->getClass(),
                             'filter_choice' => array('request_method' => 'all'),
                             'required'      => false
                         ), array(
                             'link_parameters' => array(
                                 'siteId' => $this->getSubject() ? $this->getSubject()->getSite()->getId() : null
                             )
                         ))
                     ->end()
                 ;
             }
     */
     if ($this->hasSubject() && !$this->getSubject()->isCms()) {
         $formMapper->with($this->trans('form_page.group_advanced_label'), array('collapsed' => false))->add('decorate', null, array('required' => false))->end();
     }
     $formMapper->with($this->trans('form_page.group_advanced_label'), array('collapsed' => false))->add('pageAlias', null, array('required' => false))->add('javascript', null, array('required' => false))->add('stylesheet', null, array('required' => false))->add('rawHeaders', null, array('required' => false))->end();
     $formMapper->setHelps(array('name' => $this->trans('help_page_name')));
 }
开发者ID:peruginni,项目名称:orangegate4-page-bundle,代码行数:54,代码来源:PageAdmin.php

示例7: configureFormFields

 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     // define group zoning
     $formMapper->with('form_page.group_main_label', array('class' => 'col-md-6'))->end()->with('form_page.group_seo_label', array('class' => 'col-md-6'))->end()->with('form_page.group_advanced_label', array('class' => 'col-md-6'))->end();
     if (!$this->getSubject() || !$this->getSubject()->isInternal() && !$this->getSubject()->isError()) {
         $formMapper->with('form_page.group_main_label')->add('url', 'text', array('attr' => array('readonly' => 'readonly')))->end();
     }
     if ($this->hasSubject() && !$this->getSubject()->getId()) {
         $formMapper->with('form_page.group_main_label')->add('site', null, array('required' => true, 'read_only' => true))->end();
     }
     $formMapper->with('form_page.group_main_label')->add('name')->add('enabled', null, array('required' => false))->add('position')->end();
     if ($this->hasSubject() && !$this->getSubject()->isInternal()) {
         $formMapper->with('form_page.group_main_label')->add('type', 'sonata_page_type_choice', array('required' => false))->end();
     }
     $formMapper->with('form_page.group_main_label')->add('templateCode', 'sonata_page_template', array('required' => true))->end();
     if (!$this->getSubject() || $this->getSubject() && $this->getSubject()->getParent() || $this->getSubject() && !$this->getSubject()->getId()) {
         $formMapper->with('form_page.group_main_label')->add('parent', 'sonata_page_selector', array('page' => $this->getSubject() ?: null, 'site' => $this->getSubject() ? $this->getSubject()->getSite() : null, 'model_manager' => $this->getModelManager(), 'class' => $this->getClass(), 'required' => false, 'filter_choice' => array('hierarchy' => 'root')), array('admin_code' => $this->getCode(), 'link_parameters' => array('siteId' => $this->getSubject() ? $this->getSubject()->getSite()->getId() : null)))->end();
     }
     if (!$this->getSubject() || !$this->getSubject()->isDynamic()) {
         $formMapper->with('form_page.group_main_label')->add('pageAlias', null, array('required' => false))->add('target', 'sonata_page_selector', array('page' => $this->getSubject() ?: null, 'site' => $this->getSubject() ? $this->getSubject()->getSite() : null, 'model_manager' => $this->getModelManager(), 'class' => $this->getClass(), 'filter_choice' => array('request_method' => 'all'), 'required' => false), array('admin_code' => $this->getCode(), 'link_parameters' => array('siteId' => $this->getSubject() ? $this->getSubject()->getSite()->getId() : null)))->end();
     }
     if (!$this->getSubject() || !$this->getSubject()->isHybrid()) {
         $formMapper->with('form_page.group_seo_label')->add('slug', 'text', array('required' => false))->add('customUrl', 'text', array('required' => false))->end();
     }
     $formMapper->with('form_page.group_seo_label', array('collapsed' => true))->add('title', null, array('required' => false))->add('metaKeyword', 'textarea', array('required' => false))->add('metaDescription', 'textarea', array('required' => false))->end();
     if ($this->hasSubject() && !$this->getSubject()->isCms()) {
         $formMapper->with('form_page.group_advanced_label', array('collapsed' => true))->add('decorate', null, array('required' => false))->end();
     }
     $formMapper->with('form_page.group_advanced_label', array('collapsed' => true))->add('javascript', null, array('required' => false))->add('stylesheet', null, array('required' => false))->add('rawHeaders', null, array('required' => false))->end();
     $formMapper->setHelps(array('name' => $this->trans('help_page_name')));
 }
开发者ID:cezar77,项目名称:SonataPageBundle,代码行数:34,代码来源:PageAdmin.php

示例8: configureFormFields

 /**
  * (non-PHPdoc).
  *
  * @see \Sonata\AdminBundle\Admin\Admin::configureFormFields()
  */
 protected function configureFormFields(FormMapper $form)
 {
     if ($this->getSubject() == null || $this->getSubject()->getId() === null) {
         $form->add('path', 'text', array('mapped' => false));
     }
     $form->add('alias', 'text');
     $form->add('title', 'text');
     $form->add('keywords', 'text');
     $form->add('description', 'textarea', array());
     $form->add('metatags', 'textarea', array('label' => 'additional metatags'));
     $form->setHelps(array('metatags' => 'help.metatags'));
 }
开发者ID:vstm,项目名称:IbrowsSimpleSeoBundle,代码行数:17,代码来源:MetaTagAdmin.php

示例9: configureFormFields

 public function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('General')->add('slug', null, array('required' => false))->add('title')->add('content', $this->contentType)->add('published', null, array('required' => false))->end()->with('SEO')->add('metaKeywords', null, array('required' => false))->add('metaDescription', null, array('required' => false))->end();
     $formMapper->setHelps(array('slug' => 'Leave blank for automatic filling from title field'));
 }
开发者ID:lexxpavlov,项目名称:pagebundle,代码行数:5,代码来源:PageAdmin.php


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