aoepeople/aoe_extendedfilter
最新稳定版本:v3.0.0
Composer 安装命令:
composer require aoepeople/aoe_extendedfilter
包简介
Magento extensible template filter directive support
README 文档
README
Aoe_ExtendedFilter Magento Module
License
Contributors
- Lee Saferite (AOE)
Compatability
- Model Rewrites
- core/email_template_filter
- cms/template_filter
- widget/template_filter
- Module Dependencies
- Mage_Core
- Mage_Cms
- Mage_Widget
Usage
This module extends the core, cms, and widget filter models to make adding new directives a simple process. After installation you can add new directives with a simple addition to the config.xml of your module and a new model class. The config.xml of this module includes two new directives, 'config' and 'translate', that are added using the new XML config.
<config>
<global>
<filter>
<directives>
<translate>Aoe_ExtendedFilter/Directive_Translate</translate>
<config>Aoe_ExtendedFilter/Directive_Config</config>
</directives>
</filter>
</global>
</config>
The element name for your directive is the name used to call the directive.
NB: Directive names are currently limited to 10 characters and limited to a-z. The regex pattern used is [a-z]{0,10}.
<translate>...</translate>
{{translate ... }}
The new directive model class needs to implement the Aoe_ExtendedFilter_Model_Directive_Interface interface
class Aoe_ExtendedFilter_Model_Directive_Translate implements Aoe_ExtendedFilter_Model_Directive_Interface
Usage of the new directives is identical to the existing directives.
{{translate text="Hello World"}}
{{config path="general/store_information/phone"}}
Dev Notes
The $params array passed to the process() method on a directive is the result of a preg_match_all call and as such the 0 index is the full matched text, 1 is the directive name, and 2 is everything else. The 2 index should be passed to the parameter parser in most, but not all, cases. This will result in key/value pairs of data that were passed as arguments to the directive. It will also resolve any template variables to their final value. So, given this directive in template:
{{translate text="Hello World"}}
Then the initial $params array passed to the process() method would be:
$params[0] === 'translate text="Hello World"';
$params[1] === 'translate';
$params[2] === ' text="Hello World"';
After parsing with the following code:
// Re-parse the third parameter with the tokenizer and discard original parameters
$params = $filter->getIncludeParameters($params[2]);
You will get:
$params['text'] === 'Hello World';
aoepeople/aoe_extendedfilter 适用场景与选型建议
aoepeople/aoe_extendedfilter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 570 次下载、GitHub Stars 达 6, 最近一次更新时间为 2015 年 08 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「template」 「filter」 「magento」 「directive」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aoepeople/aoe_extendedfilter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aoepeople/aoe_extendedfilter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aoepeople/aoe_extendedfilter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Nova searchable filter for belongsTo relationships.
Symfony DataGridBundle
Data provider for yii2
This Laravel Nova package allows you to detach filters from the filter dropdown
Laravel filter elequent
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
统计信息
- 总下载量: 570
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 14
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-08-24
