controlabs / routify-slim-handler
Slim Handler for Routify, a PHP Routing Abstraction
v0.1
2018-10-24 16:50 UTC
Requires
- php: ^7.1
- controlabs/routify: ^1
Requires (Dev)
- phpstan/phpstan: ^0.10.3
- phpunit/phpunit: ^7
- slim/slim: ^3.0
This package is auto-updated.
Last update: 2024-10-26 05:16:23 UTC
README
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.