Closed gg22mm closed 4 months ago
You won't be able to achieve that as part of the route registration, as you don't have the context of the request.
You should rather point to a single handler and differentiate the flows there.
You may also consider using Laminas Mezzio or SlimPHP to have tools like middleware to make your process easier (you can still use FastRoute under the hood).
如何 同一个url, 根据pc或者h5来使用不同的控制器。 达到显示不同的内容 ? How to use different controllers for the same URL based on PC or H5. To display different content?
如何能达到上面的效果呢? How can we achieve the above effect?