1. Go to this page and download the library: Download inpsyde/filter 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/ */
inpsyde / filter example snippets
$filter = new Inpsyde\Filter\DateTime();
$value = $filter->filter( '21.06.1987' ); // converts to: 1987-06-21
namespace My\Own\Filter;
use Inpsyde\Filter\AbstractFilter;
class YourFilter extends AbstractFilter {
/**
* Optional: set some options, which can be overwritten by constructor.
* @var array
*/
protected $options = [
'key' => 'value'
];
/**
* {@inheritdoc}
*/
public function filter( $value ) {
// do something
return $value;
}
}
// Optional: set "new value" to Filter.
$options = [ 'key' => 'new value' ];
$filter = new YourFilter( $options );
$value = $filter->filter( 'my value' );
$factory = new \Inpsyde\Filter\FilterFactory();
$filter = $factory->create( 'DateTime' ); // returns instance of \Inpsyde\Filter\DateTime
$factory = new \Inpsyde\Filter\FilterFactory();
$filter = $factory->create( My\Own\Filter\YourFilter::class ); // Creates an instance of your own filter.
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.