PHP code example of thecookieshows / request-parameter-manager

1. Go to this page and download the library: Download thecookieshows/request-parameter-manager 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/ */

    

thecookieshows / request-parameter-manager example snippets


$queryManager = new QueryManager([new QueryParameter('id')], $request->request);

$queryParameter = new QueryParameter('id', '1', false);

$id = $queryManager->getParameterValue('id');

$requestParameter->setParser(new DateParser();

class DatetimeParser implements ParserInterface
{
    public function parse(string $input, string $format = "d-m-Y H:i:s") : \DateTime
    {
        return \DateTime::createFromFormat($format, $input);
    }
}