dongxi1320 2016-11-29 09:23
浏览 13
已采纳

范围symfony表单输入

i'm looking for something to make this kind of input in symfony [sample]

I don't know wich kind of input and how to deal with the symfony controller.

$form = $this->createFormBuilder($newLot)
        ->add('lotType',null,['required' => false])
        ->add('lotGenre',null,['required' => false])
        ->add('ville',null)
        ->add('quartier',null)
        ->add('prix',null,['required' => false])
        ->add('prix', null,['required' => false])
        ->add('superficie', RangeType::class,['required' => false])
        ->add('createdAt', RangeType::class,['required' => false])
        ->add('gestionnaire',null)
        ->add('lotStatut',null)
        ->getForm();

Here is a part of my controller but not sure it's usefull .

Thank's

  • 写回答

1条回答 默认 最新

  • 普通网友 2016-11-29 09:43
    关注

    If you want to represent a start date linked to an end date, I'd advise you to create two DateType fields, like this:

    ->add('startDate', DateType::class, [some_parameters])
    ->add('endDate', DateType::class, [some_parameters])
    

    Then, you design your two fields in your template, by adding the "à" cell between them.

    The RangeType is not appropriate to render dates, it renders this kind of input.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)