ActionSuffixRouter
Similar to SMF\ActionRouter, but designed to build routes for actions that are appended to board or topic routes rather than having their own independent routes.
For example, this trait's buildRoute() method would rewrite the query string '?action=post;topic=123' as '/topics/123/post' instead of '/post/?topic=123'.
Note that routes built by this trait will be parsed by Board::parseRoute() or Topic::parseRoute() rather than by the parseRoute() method of the class that uses this trait.
Table of Contents
Methods
- buildRoute() : array<string|int, mixed>
- Builds a routing path based on URL query parameters.
Methods
buildRoute()
Builds a routing path based on URL query parameters.
public
static buildRoute(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
URL query parameters.
Return values
array<string|int, mixed> —Contains two elements: ['route' => [], 'params' => []]. The 'route' element contains the routing path. The 'params' element contains any $params that weren't incorporated into the route.