0

我只想将EasyAdminBundle用于我的后端。但是通过composer安装后,如果单击编辑或创建按钮,则会出现以下错误:

如果我单击后端中的“创建”按钮(或任何“编辑”按钮),我会收到以下错误消息:

@EasyAdmin/form/bootstrap_3_horizo​​ntal_layout.html 中不存在键为“css_class, format, help, label, type, fieldType, dataType, virtual, sortable, template, type_options, fieldName, columnName, property”的数组的键“可为空”。第 39 行的树枝

我没有改变我的实体。EasyAdminConfiguration 是这样的:

easy_admin:
    site_name: 'backend'
    design:
        form_theme: 'vertical'
    entities:
        Blogpost:
            class:      NI\BlogBundle\Entity\Post
            label:      Artikel
        BlogKategorie:
            class:      NI\BlogBundle\Entity\PostCategory
            label:      Kategorien
        Benutzer:
            class:      NI\UserBundle\Entity\User
            label:      Benutzerkonten
        Unternehmen:
            class:      NI\CompanyBundle\Entity\Company
            label:      Unternehmen

有任何想法吗?

4

1 回答 1

0

There was no default value vor "nullable" defined (see bugfix on github: https://github.com/javiereguiluz/EasyAdminBundle/commit/0fac932646280e4ede02f97430aab503108897fb).

Resources/views/form/bootstrap_3_horizontal_layout.html.twig

     <div class="{{ block('form_group_class') }}">
         {{ form_widget(form) }}

     <div class="{{ block('form_group_class') }}">
         {{ form_widget(form) }}

-            {% if _field_type in ['datetime', 'datetimetz', 'date', 'time'] and easyadmin.field.nullable %}
+            {% if _field_type in ['datetime', 'datetimetz', 'date', 'time'] and easyadmin.field.nullable|default(false) %}
             <div class="nullable-control">
                 <label>
                     <input type="checkbox" {% if data is null %}checked="checked"{% endif %}>

Resources/views/form/bootstrap_3_layout.html.twig

      {{- form_label(form, _field_label|trans(_trans_parameters)) -}}
     {{- form_widget(form) -}}

-        {% if _field_type in ['datetime', 'datetimetz', 'date', 'time'] and easyadmin.field.nullable %}
+        {% if _field_type in ['datetime', 'datetimetz', 'date', 'time'] and easyadmin.field.nullable|default(false) %}
         <div class="nullable-control">
             <label>
                 <input type="checkbox" {% if data is null %}checked="checked"{% endif %}>
于 2016-02-05T14:31:21.673 回答