Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iturgeon/fuel-filter
FuelPhP Filtered View Module Extension
https://github.com/iturgeon/fuel-filter
Last synced: about 2 months ago
JSON representation
FuelPhP Filtered View Module Extension
- Host: GitHub
- URL: https://github.com/iturgeon/fuel-filter
- Owner: iturgeon
- License: mit
- Created: 2014-02-22T17:09:14.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-22T19:00:21.000Z (almost 11 years ago)
- Last Synced: 2024-10-12T19:37:00.149Z (3 months ago)
- Language: PHP
- Size: 176 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Fuel Filter Views
===================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:
```php
// 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
```php
namespace \Filter;
class ReverseFilter extends Filter
{
public static function process($string)
{
return strrev($string);
}
}
```Usage:
```php
// 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.
1. Add `"iturgeon/fuelfilter" : "1.0.*"` to your require section in composer.json
2. Run `php composer.phar update`Sample Section of composer.json:
```
"require": {
...
"iturgeon/fuelfilter" : "1.0.*"
}
```