accolon / route
Library routes php
8.0
2021-09-19 16:01 UTC
Requires
- php: >=8.0
- accolon/container: ^2.0
- dev-master
- 8.0
- 7.x-dev
- 7.1.0
- 7.0.6
- 7.0.5
- 7.0.4
- 7.0.3
- 7.0.2
- 7.0.1
- 7.0.0
- 6.x-dev
- 6.0.0
- 5.9.0
- 5.8.0
- 5.7.0
- 5.6.0
- 5.5.0
- 5.4.2
- 5.4.1
- 5.4.0
- 5.3.2
- 5.3.1
- 5.3.0
- 5.2.2
- 5.2.1
- 5.2.0
- 5.1.0
- 5.0.0
- 4.7.0
- 4.6.0
- 4.5.0
- 4.4.3
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.0
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.1
- 4.0.1
- 4.0.0
- 3.8.2
- 3.8.0
- 3.7.1
- 3.7.0
- 3.6.1
- 3.6.0
- 3.5.0
- 3.4.0
- 3.3.1
- 3.3.0
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.0
- 1.0.0
This package is auto-updated.
Last update: 2024-10-19 23:12:47 UTC
README
<?php use Accolon\Route\App; use Accolon\Route\Controller as RouteController; use Accolon\Route\Middlewares\Cors; use Accolon\Route\Request; use Accolon\Route\Response; require_once "../vendor/autoload.php"; function dd($var) { ?> <pre> <?php var_dump($var); exit; } class User { // } class Controller extends RouteController { private User $user; public function __construct(User $user) { $this->user = $user; } public function show(Request $request) { $this->validate([ 'id' => 'int' ]); return response()->text('success'); } } $router = new App(); $router->middleware(Cors::class); $router->get('/user/{id}', [Controller::class, 'show']); $router->dispatch();