dafiti/querystring-listener

Dafiti Query String Listener

This package's canonical repository appears to be gone and the package has been frozen as a result.

0.0.3 2016-09-12 14:00 UTC

This package is not auto-updated.

Last update: 2021-06-12 00:44:36 UTC


README

Build Status Scrutinizer Code Quality Code Coverage HHVM Latest Stable Version Total Downloads License

Parsing query string with multiple values and same names.

Instalation

The package is available on Packagist. Autoloading is PSR-4 compatible.

{
    "require": {
        "dafiti/querystring-listener": "dev-master"
    }
}

Usage

Basic

use Dafiti\Silex\Listener;
use Silex\Application;

$app = new Application();

$app['dispatcher']->addSubscriber(new Listener\QueryString());

Example:

//http:url.com?param=foo&filter=a:b&filter=c=d

var_dump($request->get('param'));
var_dump($request->get('filter'));

The example above will print:

string(3) "foo"
array(3) {
  [0]=>
  string(3) "a:b"
  [1]=>
  string(3) "c:d"
}

License

MIT License