ilias / opherator
Package to handle requests
Installs: 135
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/ilias/opherator
Requires (Dev)
- phpunit/phpunit: ^11.2
This package is auto-updated.
Last update: 2025-10-17 14:20:15 UTC
README
This PHP router system allows you to define and manage your application's routes in a simple and organized manner, inspired by Laravel's routing system.
Installation
To install the package, add it to your composer.json file:
{
"require": {
"ilias/opherator": "1.0.0"
}
}
Or simply run the terminal command
composer require ilias/opherator
Then, run the following command to install the package:
composer install
Usage
Step 1: Setup The Handler
Create a file to define your routes, for example, in your project root folder, routes.php:
<?php use Ilias\Opherator\\Request; Request::setup();
Step 2: Use As Your Needs
The handler provides the next methods:
class Request { public static function getMethod() : string; public static function getBody(): array; public static function getQuery(): array; public static function hasBody(): bool; }
And the Response provides:
class Response { public static function setResponse(array $response): void; public static function appendResponse(string $key = "data", string|array $response, bool $override = true): void; public static function jsonResponse(): void; public static function htmlResponse(): void; public static function answer(): void; }