heimrichhannot/contao-entity_filter

本模块提供了一种输入类型,通过轻松“点击”类似SQL的条件,方便地选择一个或多个实体。

安装: 144

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 5

分支: 0

类型:contao-module

1.1.3 2017-06-27 15:22 UTC

This package is not auto-updated.

Last update: 2024-09-14 20:20:07 UTC


README

本模块提供了一种输入类型,通过轻松“点击”类似SQL的条件,方便地选择一个或多个实体。

alt text

特性

  • “点击”条件以过滤(即选择)任意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',
    )
);