Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3a10c34367 | ||
![]() |
f533c70e68 | ||
![]() |
e3bea629aa | ||
![]() |
66add99a34 |
@ -27,7 +27,7 @@ Requires PHP 8.1 or newer
|
||||
|
||||
- [Usage](#usage)
|
||||
- [FrankenPHP Worker Mode](#frankenphp-worker-mode)
|
||||
- [Basic Routing](#basic-routing)
|
||||
- [Basic Routing](#basic-routing)
|
||||
- [Available Methods](#available-methods)
|
||||
- [Multiple HTTP-verbs](#multiple-http-verbs)
|
||||
- [Route Parameters](#route-parameters)
|
||||
@ -58,7 +58,7 @@ Here's a basic getting started example:
|
||||
```php
|
||||
<?php
|
||||
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
use Wilaak\Http\Route2;
|
||||
|
||||
@ -80,7 +80,7 @@ Boot your application once and keep it in memory by using [worker mode](https://
|
||||
|
||||
ignore_user_abort(true);
|
||||
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
use Wilaak\Http\Route2;
|
||||
|
||||
@ -131,7 +131,7 @@ Route2::match('get|post', '/', function() {
|
||||
// matches any method you like
|
||||
});
|
||||
|
||||
Route2::forms('/', function() {
|
||||
Route2::form('/', function() {
|
||||
// matches GET and POST methods
|
||||
});
|
||||
|
||||
|
@ -309,7 +309,7 @@ class Route2
|
||||
public static function dispatch(?string $method = null, ?string $uri = null): bool
|
||||
{
|
||||
$method = strtoupper($method ?? $_SERVER['REQUEST_METHOD']);
|
||||
$uri = rawurldecode($uri = strtok($uri ?? self::getRelativeRequestUri(), '?'));
|
||||
$uri = rawurldecode(strtok($uri ?? self::getRelativeRequestUri(), '?'));
|
||||
|
||||
$routes = self::matchRoute($uri);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user