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.

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

报告相同问题?

悬赏问题

  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥15 复杂网络,变滞后传递熵,FDA
  • ¥20 csv格式数据集预处理及模型选择
  • ¥15 部分网页页面无法显示!
  • ¥15 怎样解决power bi 中设置管理聚合,详细信息表和详细信息列显示灰色,而不能选择相应的内容呢?
  • ¥15 QTOF MSE数据分析
  • ¥15 平板录音机录音问题解决
  • ¥15 请问维特智能的安卓APP在手机上存储传感器数据后,如何找到它的存储路径?