controlabs/routify-slim-handler

Slim Handler for Routify, a PHP Routing Abstraction

v0.1 2018-10-24 16:50 UTC

This package is auto-updated.

Last update: 2024-10-26 05:16:23 UTC


README

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.