Skip to content

Filter interface and abstract for all District5 filters

License

Notifications You must be signed in to change notification settings

district-5/php-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

District5 Filter Library

About

This library provides the skeletons to support filters.

Installation

This library requires no other libraries.

composer require district5/filter

Usage

Filter

All filters that implement the filter interface in this library must implement a filter() function that returns the filtered value, for example a filter to make a string lowercase might look as follows:

use \District5\Filter\FilterInterface;

class MyStringToLowerFilter implements FilterInterface
{
    public function filter($value)
    {
        if (extension_loaded('mbstring')) {
            return mb_strtolower($value);
        }

        return strtolower($value);
    }
}

Issues

Log a bug report!

About

Filter interface and abstract for all District5 filters

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages