dongxia527680 2014-10-28 10:42
浏览 26

在symfony中使用formfield时的逻辑异常

I'm trying to use this DatePicker form type in my Twig form:
https://github.com/mohebifar/DateTimeBundle
Using jquery widget as described here:
https://github.com/mohebifar/DateTimeBundle/blob/master/Resources/doc/2.3-date-picker-form-type.md

Like this:

{% 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 %} 

But I'm getting this LogicException at the line form_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".

What is the problem?


Update:
I added the theme:

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

But still same exception occurs!

  • 写回答

1条回答 默认 最新

  • dongpo2014 2014-10-28 11:21
    关注

    This seems to me like missing form theme. I would assume that this bundle came with written theme which extends the basic but also adds the those blocks.

    If you're unfamiliar with form themes please see this link: http://symfony.com/doc/current/cookbook/form/form_customization.html#method-2-inside-a-separate-template

    评论

报告相同问题?

悬赏问题

  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏