alberto-cruz-mtz/vanilla-router 问题修复 & 功能扩展

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

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

alberto-cruz-mtz/vanilla-router

最新稳定版本:v0.1.1

Composer 安装命令:

composer require alberto-cruz-mtz/vanilla-router

包简介

Enrutador HTTP inspirado en Express para PHP con tipos estrictos, canalización de middleware y manejo de errores limpio. permitiendo utilizar un enrutador basico sin librerias pesadas

README 文档

README

A lightweight, zero-dependency HTTP router for PHP 8.1+, inspired by Express.js.

Documentation:

Requirements

  • PHP >= 8.1

Installation

composer require alberto-cruz-mtz/vanilla-router

Quick Start

<?php

require 'vendor/autoload.php';

use Router\Router;
use Router\Request;
use Router\Response;

$router = new Router();

$router->get('/', static function (Request $req, Response $res): void {
    $res->json(['message' => 'Hello, World!']);
});

$router->get('/users/:id', static function (Request $req, Response $res): void {
    $id = $req->param('id');
    $res->json(['id' => $id]);
});

$router->dispatch();

License

MIT — jose alberto cruz martinez

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-12