我只想将EasyAdminBundle用于我的后端。但是通过作曲家安装后,如果我单击编辑或创建按钮,我会收到以下错误:
如果我单击后端中的"创建"按钮(或任何"编辑"按钮),则会收到以下错误消息:
带有键"css_class、格式、帮助、标签、类型、字段类型、数据类型、虚拟、可排序、模板、type_options、字段名称、列名称、属性"的数组的键"可为空"在第 39 行的 @EasyAdmin/form/bootstrap_3_horizontal_layout.html.twig 中不存在
我对我的实体没有改变任何东西。EasyAdmin配置是这样的:
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
有什么想法吗?
没有定义默认值vor "nullable"(请参阅github上的错误修复:https://github.com/javiereguiluz/EasyAdminBundle/commit/0fac932646280e4ede02f97430aab503108897fb)。
资源/视图/表单/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 %}>
资源/视图/表单/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 %}>