1. Go to this page and download the library: Download grephq/php-router 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/ */
class User extends BaseController
{
public static function get()
{
render('index.php', array('title' => 'Index Page'));
}
public static function post()
{
json(reqVar('name'), 200);
}
public static function delete()
{
xml('Delete Request', 200);
}
}
app.php
bash
git clone https://github.com/Tomiwa-Ot/php-router.git
cd php-router
composer install
bash
composer create-project grephq/php-router
cd php-router
composer install
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.