【问题标题】:week picker symfony form周选择器 symfony 表单
【发布时间】:2016-10-10 12:26:41
【问题描述】:

我想要这样的等价物:

<input type="week" (...)>

使用 Symfony 表单。

我试试这个:

{{ form_widget(form.date, {'attr': {'type': 'week'}}) }}

但它不起作用,我明白了:

<input type="date" (...) required="required" class="form-control" type="week" />

我使用这种类型:

DateType::class

谢谢。

【问题讨论】:

标签: html forms symfony


【解决方案1】:

您使用的方法{'attr': {'type': 'week'}} 只会插入另一个类型属性。问题在于 DateType::class。虽然我调查了它,但我很确定 symfony 目前不支持&lt;input type= "week" /&gt;。或者用外行的话来说,目前 symfony 中没有 WeekType::class 可用。

【讨论】:

    猜你喜欢
    • 2017-08-14
    • 1970-01-01
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-08
    相关资源
    最近更新 更多