ilias/opherator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ilias/opherator

最新稳定版本:1.0.8

Composer 安装命令:

composer require ilias/opherator

包简介

Package to handle requests

README 文档

README

Maintainer Package Source Code Software License

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

统计信息

  • 总下载量: 135
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-11