bernard-arhia/routee 问题修复 & 功能扩展

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

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

bernard-arhia/routee

最新稳定版本:0.1.0

Composer 安装命令:

composer require bernard-arhia/routee

包简介

A very simple and lightweight routing library for PHP.

README 文档

README

A lightweight php routing service for writing fullstack applications in PHP.

Notice

Make sure you are using php version >= 8.0.1

Installation

composer require bernard-arhia/routee

Example

A simple route service

index.php

use Http\Router;
require_once  __DIR__  .  "/vendor/autoload.php";

$router  =  new  Router;
$router->get("/", function(){
echo  "Hello world";
});

$router->run();

Now open the terminal and start your php web server

php -S localhost:9000

This will start the php server on port 9000 In your browser open http://localhost:9000 to preview the example A screenshot

The Route accepts the following http request methods

  • GET ($router->get())
  • POST ($router->post())
  • PUT ($router->put())
  • DELETE ($router->delete())
  • PATCH ($router->patch())

The router accepts basically the following parameters

  • (string) $path: the path of the route
  • (method) $callback: the callback function to be executed when the route is matched (You can also pass in a class method)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固