Routes
class Routes implements RoutesInterface
Routes storage
Properties
protected RoutesStorageInterface | $adapter | Routes storage adapter | |
protected CacheInterface | $cache | Cache |
Methods
Add route middleware
Set routes status
Save route redirect url
Add template route
Add home page route
Add page route
Get language pattern
Add api route
Return true if reoute exists
Delete route
Save route options
Delete home page route
Delete routes
Get route
Get route details
Get routes
Get all actve routes from storage
Get routes list for request method
Get home page route
Details
at line 44
__construct(RoutesStorageInterface $adapter, CacheInterface $cache)
Constructor
at line 58
bool
addMiddleware(string $method, string $pattern, string $middlewareClass)
Add route middleware
at line 70
bool
setRoutesStatus(array $filter = [], int $status)
Set routes status
at line 83
bool
setRedirectUrl(string $method, string $pattern, string $url)
Save route redirect url
at line 103
bool
saveTemplateRoute(string $pattern, string $handlerClass, string|null $handlerMethod, string $templateName, string|null $pageName, integer|null $auth = null, bool $replace = false, string|null $redirectUrl = null, int $type = RoutesInterface::PAGE, bool $withLanguage = true)
Add template route
at line 176
bool
addHomePageRoute(string $pattern, string $handlerClass, string $handlerMethod, string|null $extension, string $pageName, integer $auth = null, string|null $name = null, bool $withLanguage = true)
Add home page route
at line 214
bool
addPageRoute(string $pattern, string $handlerClass, string $handlerMethod, string $extension, string|null $pageName, string|null $auth = null, string|null $name = null, bool $withLanguage = true, integer $type = RoutesInterface::PAGE)
Add page route
at line 268
string
getLanguagePattern(string $pattern)
Get language pattern
at line 286
bool
addApiRoute(string $method, string $pattern, string $handlerClass, string|null $handlerMethod, string|null $extension, string|null $auth = null, int $type = RoutesInterface::API)
Add api route
at line 331
bool
has(string $method, string $pattern)
Return true if reoute exists
at line 343
bool
delete(string $method, string $pattern)
Delete route
at line 356
bool
saveRouteOptions(string $method, string $pattern, array $options)
Save route options
at line 366
bool
deleteHomePage()
Delete home page route
at line 377
bool
deleteRoutes($filter = [])
Delete routes
at line 389
array|false
getRoute(string $method, string $pattern)
Get route
at line 400
array|null
getRouteDetails(string|int $id)
Get route details
at line 411
array
getRoutes(array $filter = [])
Get routes
at line 421
array
getAllRoutes()
Get all actve routes from storage
at line 439
array
searchRoutes(string $method, $type = null)
Get routes list for request method
at line 456
array
getHomePageRoute()
Get home page route