heimrichhannot / contao-entity_filter
本模块提供了一种输入类型,通过轻松“点击”类似SQL的条件,方便地选择一个或多个实体。
1.1.3
2017-06-27 15:22 UTC
Requires
- php: ~5.4 || ~7.0
- contao-community-alliance/composer-plugin: ~2.4 || ~3.0
- contao/core-bundle: ^3.5.1 || ~4.1
- heimrichhannot/contao-field_value_copier: ~1.0
- heimrichhannot/contao-haste_plus: ^1.5
- heimrichhannot/contao-list_widget: ~2.0
- heimrichhannot/contao-multi_column_editor: ~1.0
README
本模块提供了一种输入类型,通过轻松“点击”类似SQL的条件,方便地选择一个或多个实体。
特性
- “点击”条件以过滤(即选择)任意contao实体
- 从其他记录加载现有的过滤条件
- 在contao记录的编辑视图中直接显示过滤结果列表
技术说明
本模块提供了3种舒适的不同功能,可以将之前提到的小部件直接添加到您的dca中。
注意:当然,如果您不满足这些3个功能,也可以复制它们并自定义它们。
将实体过滤器小部件添加到您的dca
\HeimrichHannot\EntityFilter\Backend\EntityFilter::addFilterToDca(
// the name of the field
'memberConditions',
// your dca
'tl_md_recipient_list',
// the table to be filtered
'tl_member'
);
添加一个字段,用于从其他记录复制实体过滤器
\HeimrichHannot\EntityFilter\Backend\EntityFilter::addFilterCopierToDca(
// the name of the field
'filterCopier',
// your dca
'tl_recipient_list',
// the dca where the field values are situated you want to copy (usually the same as your dca)
'tl_recipient_list',
// the entity_filter field
'memberConditions',
// a custom options_callback -> if left out, array('HeimrichHannot\FieldValueCopier\Backend\FieldValueCopier', 'getOptions') is used
array('Namespace\SomeClass', 'getOptions')
);
添加一个实时重载的表格,以显示您条件的结果
\HeimrichHannot\EntityFilter\Backend\EntityFilter::addListToDca(
// the name of the field
'memberList',
// your dca
'tl_recipient_list',
// the entity_filter field
'memberConditions',
// the table being filtered
'tl_member',
// the header fields of the table
array(
'title',
'firstname',
'lastname',
'email',
)
);