承接 blank-framework/file-path-router 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

blank-framework/file-path-router

最新稳定版本:3.0.0

Composer 安装命令:

composer require blank-framework/file-path-router

包简介

Package for the Blank Framework FilePathRouter

README 文档

README

FilePathRouter is a simple routing package that maps a path such as /blog/posts to the directory /blog/posts. If that directory exists, it executes the index.php file inside.

Usage

To start, instantiate the FilePathRouter class and pass the absolute path to the directory where your routes will be located. If it is in the root of your project directory is could be like the code snippet below:

$router = new FilePathRouter(__DIR__ . '/routes');

To route your requests, get the requested path for example /blog and pass it into the function routeRequest as shown below:

$router->routeRequest('/blog');

Directory Structure and Routing

FilePathRouter's routing mechanism is dependent on your project's directory structure. The home route (/) is mapped to the index.php file in the /routes directory. To create a new path, such as /blog, simply create a directory named blog within /routes. Place an index.php file in this new directory, and this file will be executed whenever the /blog path is requested.

Exceptions

If the routes path you provided in the constructor does not exist, the router will throw a RoutesPathNotFoundException. If the requested route could not be found, the router will throw a RouteNotFoundException.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2023-11-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固