Compare commits

...

4 Commits
v1.0.0 ... main

Author SHA1 Message Date
William
3a10c34367
Remove unnecessary variable 2025-04-19 23:51:43 +02:00
William
f533c70e68
Update README.md 2025-04-19 23:48:01 +02:00
William
e3bea629aa
Update README.md 2025-04-19 23:42:47 +02:00
Wilaak
66add99a34 Update README.md 2025-04-19 23:31:48 +02:00
2 changed files with 5 additions and 5 deletions

View File

@ -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
});

View File

@ -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);