PHP code example of mezon / request

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

    

mezon / request example snippets


var_dump(Request::getParam('some-param', 'default'));// will be outputted 'default'

$_GET['some-param'] = 'some-value';
var_dump(Request::getParam('some-param'));// will be outputted 'some-value'

$_GET['some-param'] = 'get-value';
$_POST['some-param'] = 'post-value';

var_dump(Request::getParam('some-param'));// will be outputted 'post value'

Request::registerRouter(<your Mezon\Router object>);

Request::getParam('session_id')

// will return true if the parameter exists
// will return false otherwise
Request::wasSubmitted('param-name')

Request::getChecked('param-name', ['switched on', 'switched off'])
Request::getChecked('param-name', [1, 0])
Request::getChecked('param-name', [true, false])