0

我正在尝试DatePicker在我的表单中使用此表单类型Twig
https
://github.com/mohebifar/DateTimeBundle 使用jquery此处描述的小部件:
https ://github.com/mohebifar/DateTimeBundle/blob/master/Resources/doc/ 2.3-日期选择器-form-type.md

像这样:

{% block headassets %}
    {% stylesheets 'bundles/itwuser/css/*.css' filter='cssrewrite' %}
        <link rel="stylesheet" href="{{ asset_url }}" />
    {% endstylesheets %}

    {{ form_datetime_css(form) }}
    {{ form_datetime_js_asset(form) }}
    {{ form_datetime_js(form) }}
{% endblock %} 

但我马上就知道LogicExceptionform_datetime_css(form)

LogicException: Unable to render the form as none of the following blocks exist: "_itw_userbundle_user_css", "itw_userbundle_user_css", "form_css".

问题是什么?


更新:
我添加了主题:

{% form_theme form 'MohebifarDateTimeBundle::form_fields.html.twig' %}

但仍然发生同样的异常!

4

1 回答 1

1

在我看来,这就像缺少表单主题。我会假设这个捆绑包带有书面主题,它扩展了基本但也添加了这些块。

如果您不熟悉表单主题,请查看此链接:http ://symfony.com/doc/current/cookbook/form/form_customization.html#method-2-inside-a-separate-template

于 2014-10-28T11:21:00.003 回答