Skip to content

Slim Handler for Routify, a PHP Routing Abstraction

License

Notifications You must be signed in to change notification settings

controlabs/routify-slim-handler

Repository files navigation

routify-slim-handler

Build Status Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status PHPStan

License Latest Stable Version Latest Unstable Version composer.lock Total Downloads

Installation

composer require controlabs/routify-slim-handler

How to use

// 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());

License

This software is open source, licensed under the The MIT License (MIT). See LICENSE for details.