0

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 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

3 Comments

I added the theme with {% form_theme form 'MohebifarDateTimeBundle::form_fields.html.twig' %} but still getting same exception!
Did you do it before invoking form_datetime_css?
Yes, at the beginning of the file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.