定制 fahrradkrucken/sf-router 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fahrradkrucken/sf-router

Composer 安装命令:

composer require fahrradkrucken/sf-router

包简介

Simple, single-file, dependency-free PHP router.

README 文档

README

Info

This is the simple router, implemented in one file, that could be used through traditional composer-dependency or through require statement.

Installation

  • Through Composer: composer require fahrradkrucken/sf-router.
  • As a separate file: require('path/to/sf-router.php').

Features

Basically, it allows us to (almost) do everything we usually do with routers:

  • Add GET/POST/PUT/PATCH/DELETE routes (or several request methods at once);
  • Add route groups;
  • Add callbacks to routes/route-groups as well as add before/after actions (callbacks);
  • Set custom URI and REQUEST_METHOD (as FastRoute allows us to do);
  • Set simple named params inside your route, smth like
    my-api/v2/user/{user_id}/actions/{action_id}/view.

What it can't do for you:

  • Handle your route's callback;
  • Get you the GET and POST request parameters.

So the only thing it does is takes your URI/REQUEST_METHOD and returns correct route, based on list of routes, provided by you.

Usage

See the demo.php file inside this repo to see how to use it.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-03-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固