Download the PHP package ajiader/filter-manager without Composer
On this page you can find all versions of the php package ajiader/filter-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ajiader/filter-manager
More information about ajiader/filter-manager
Files in ajiader/filter-manager
Package filter-manager
Short Description Filter manager package for product list,elegant generate url.
License
Informations about the package filter-manager
Intro
A filter manager package for the product list filter, help you elegant generate filter url.
Install
Usage
1. The preparatory work
Or used in laravel just like this:
Find the providers key in config/app.php and register the FilterManger Service Provider.
Find the aliases key in config/app.php.
2. Just enjoy it
use value $fm in template:
or use laravel facade value FilterManager in template:
API
create(array $filters, $baseUrl, $blackList)
create a instance.
-
$filters: this is filters data, required, exp:['gender'=>'male', 'city'=>'beijing'] -
$baseUrl: default value is empty string. $blackList: this is blacklist for filters, default value is[], exp:['pageindex'].
setBlackList(array $list)
set black list for filter.
example:
has($filterName)
whether has the character filter, if true will return the value, if don`t return false.
example:
isActive($filterName, $filterValue, $trueReturn, $falseReturn)
example:
url($filterName, $filterValue, $multi, $linkageRemoveFilters, $blackList)
One filter has some values, and every value has a url, this method return a full url string.
-
$filterName: param name, required. -
$filterValue: param value, default value isFM_SELECT_ALL. -
$multi: whether to support multiple values?falseortrue, default value isfalse. -
$linkageRemoveFilters:linkage remove the other filter, default value is[]. $blackList: temporary blacklist, default value is[].
example: