PHP code example of controlabs / routify-slim-handler
1. Go to this page and download the library: Download controlabs/routify-slim-handler 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/ */
controlabs / routify-slim-handler example snippets
// Routify
// Defining routes
routify = new Routify();
$routify->delete('users', \MyApp\Controllers\UserController::class, 'delete');
$routify->get('users/{id}', \MyApp\Controllers\UserController::class, 'get');
$routify->post('users', \MyApp\Controllers\UserController::class, 'create');
$routify->put('users/{id}/cancel', \MyApp\Controllers\UserController::class, 'cancel');
// Creating Slim App
$app = new \Slim\App();
// Manipulating the routes
$slimHandler = new SlimHandler($app);
$slimHandler->handle($routify->routes());