iturgeon/fuelfilter
Composer 安装命令:
composer require iturgeon/fuelfilter
包简介
Allows View Filtering with custom filters in FuelPHP framework
README 文档
README
This little add-on lets you create new FuelPHP View Filters that process the strings generated by a rendered View.
No Follow Filter
Included in the code is a sample No Follow Filter. This filter injects rel="nofollow" into html links.
Usage:
// create a new view (these extend FuelPHP's View Class) $view = \Filter\View::forge('myView'); $view->add_filters(\Filter\NoFollow::forge()); echo($view);
Creating Custom Filters
Create a new Filter class that extends our Filter class.
For example: this class named /fuel/app/classes/reversefilter.php
<? namespace \Filter; class ReverseFilter extends Filter { public static function process($string) { return strrev($string); } }
Usage:
// create a new view (these extend FuelPHP's View Class) $view = \Filter\View::forge('myView'); $view->add_filters(ReverseFilter::forge()); echo($view);
Installation
The easiest way to install in Fuel is to use composer.
- Add
"iturgeon/fuelfilter" : "1.0.*"to your require section in composer.json - Run
php composer.phar update
Sample Section of composer.json:
"require": {
...
"iturgeon/fuelfilter" : "1.0.*"
}
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-02-22