gromit/oc-routesbrowser-plugin
Composer 安装命令:
composer require gromit/oc-routesbrowser-plugin
包简介
OctoberCMS plugin for test routes in backend
README 文档
README
GromIT.RouteBrowser is the plugin for OctoberCMS helping backend developers to tell frontend friends about what routes do they have in REST API.
It collects the info about routes from code and docblocks using reflections.
Where info collects from
Every route have URI, method, action, request class, description, route parameters and request parameters.
URI, method and action are collected from Route facade, so you don't need to add anything to your code for show
this info in routes list.
// Here we got route with: uri "hello/{name}", method "GET", action "Closure" // and one route parameter with name "name" type "string" Route::get('hello/{name}', function (string $name) { // });
Route parameters names and types are collected from route itself, but route description and parameters descriptions
goes from route handler docblock.
Route parameters types from docblock overrides types from code.
// Docblock for closure adds this info to route: // description "Returns greeting" and route parameter description "Person name" Route::get('hello/{name}', /** * Returns greeting * * @param string $name Person name */ function (string $name) { // } ); // OR // Here route action will be "\Controllers\Namespace\GreetController@greet" Route::get('/hello/{name}', [GreetController::class, 'greet']); class GreetController extends \Illuminate\Routing\Controller { /** * Returns greeting * * @param string $name Person name */ public function greet(string $name) { // } }
Request class and request parameters are collected from docblock of request class used in route handler.
Route::get('/hello/{name}', [GreetController::class, 'greet']); class GreetController extends \Illuminate\Routing\Controller { /** * Returns greeting * * @param string $name Person name */ public function greet(GreetRequest $request, string $name) { // } } // These will add request class "\Requests\Namespace\GreetRequest" and request parameters: // "greeting" with type "string|null" and description "Greeting. Default - "Hello"" // and "friend" with type "string|null" and description "Friend name". /** * @property-read string|null $greeting Greeting. Default - "Hello" * @property-read string|null $friend Friend name */ class GreetRequest extends \Illuminate\Foundation\Http\FormRequest { // }
gromit/oc-routesbrowser-plugin 适用场景与选型建议
gromit/oc-routesbrowser-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 673 次下载、GitHub Stars 达 3, 最近一次更新时间为 2021 年 05 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 gromit/oc-routesbrowser-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gromit/oc-routesbrowser-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 673
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2021-05-22
