1. Go to this page and download the library: Download fg/cascade library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
class SquareFilter {
public function __invoke($value) {
return $value * $value;
}
}
$Cascade = new Cascade\Cascade([
new SquareFilter()
]);
echo $Cascade->filter(2); // 4
// constructor
$Cascade = new Cascade\Cascade();
$Cascade = new Cascade\Cascade($filters);
// accessors for the list of filters
$Cascade->filters();
$Cascade->setFilters($filters);
$Cascade->addFilter($filter);
// filter
$Cascade->filter($value [, $args...]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.