heimrichhannot/contao-entity-filter-bundle
Composer 安装命令:
composer require heimrichhannot/contao-entity-filter-bundle
包简介
This module offers an input type for selecting one or more entities by comfortably 'clicking together' sql-like conditions.
README 文档
README
This module offers an input type for selecting one or more entities by comfortably "clicking together" sql-like conditions.
Features
- "click together" conditions for filtering (aka selecting) arbitrary contao entities
- load existing filter conditions from other records
- display a result list of your filtering right in the contao record's edit view
Technical instructions
This module offers 3 comfortable different functions for adding the widgets mentioned before right to your dca.
Note: Of course, you can also copy these 3 functions and customize them if they don't suit your needs
Add the entity filter widget to your dca:
Hint: If you like to set the table to be filtered dynamically, you can do that in an onload_callback.
But you still have to call the following function in your dca and not the callback because else exclude wouldn't be set correctly.
\Contao\System::getContainer()->get('huh.entity_filter.manager')->addFilterToDca(
// the name of the field
'memberConditions',
// your dca
'tl_md_recipient_list',
// the table to be filtered
'tl_member'
);
Add a field for copying entity filters from other records:
\Contao\System::getContainer()->get('huh.entity_filter.manager')->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, ['huh.field_value_copier.util.field_value_copier_util', 'getOptions'] is used
['huh.field_value_copier.util.field_value_copier_util', 'getOptions'],
// config parameters for field value copier widget
[
'labelPattern' => '%title% (ID %id%)'
]
);
Add a live-reloaded table for showing the results of your conditions:
\Contao\System::getContainer()->get('huh.entity_filter.manager')->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',
)
);
Events
| Name | Arguments |
|---|---|
ModifyEntityFilterQueryEvent |
string $table, string $field, $activeRecord, string $query, string $where, array $values, array $listDca |
heimrichhannot/contao-entity-filter-bundle 适用场景与选型建议
heimrichhannot/contao-entity-filter-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.41k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 01 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 heimrichhannot/contao-entity-filter-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 heimrichhannot/contao-entity-filter-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 8.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 11
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2018-01-26
