PHP code example of williamheelis / restful-inputs
1. Go to this page and download the library: Download williamheelis/restful-inputs 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/ */
williamheelis / restful-inputs example snippets
$_RES['debug'] = "bob"
Inputs::extend('debug');
$_RES['debug'] = "bob"
use Restful\Inputs;
Inputs::init();
Inputs::setPath('api/something/{uid}'); //only needed if you actually have a path with params - and it assumes you're in an index.php
$uid = $_PATH['uid'] ?? null;
$name = $_JSON['name'] ?? 'guest';
$_RES['data'] = ['uid' => $uid, 'name' => $name];
$_RES['status_code'] = 200;