smic/page-router-event
Composer 安装命令:
composer require smic/page-router-event
包简介
Sends the missing PageUriGenerated PSR-14 event from the PageRouter
README 文档
README
Provides a PSR-14 event to respond to generated page URIs
The core TYPO3 PageRouter doesn't offer the possibility to modify generated URLs. This extension replaces the PageRouter->generateUri method and
dispatches a PSR-14 event to react to or modify generated URLs.
TYPO3 core issue
An issue for the TYPO3 core has been created on forge: #92780. This extension is meant as an intermediate solution and becomes obsolete as soon as the core PageRouter offers such an event.
Usage
Install:
composer req smic/page-router-event dev-master
Register an event listener in the Services.yaml:
services:
Vendor\MyExt\EventListener\ReactToGeneratedUri:
tags:
- name: event.listener
identifier: 'MyExtReactToGeneratedUri'
event: Smic\PageRouterEvent\Event\PageUriGenerated
Your event listener receives a Smic\PageRouterEvent\Event\PageUriGenerated event that offers:
- getters for input data that were used to generate the URL
->getFragment(),->getParameters(),->getRoute(),->getSite(),->getType() - a getter for the generated URI
->getUri() - the PageRouter itself
->getPageRouter() - and a setter to replace the generated URI
->setUri($uri)
If you're not familiar with PSR-14 event handling in TYPO3 have a look at: https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Hooks/EventDispatcher/Index.html
smic/page-router-event 适用场景与选型建议
smic/page-router-event 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 51.01k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 11 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 smic/page-router-event 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 smic/page-router-event 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 51.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2020-11-05