register()
register()
InterceptorMiddleware allows the client template to provide a callback for a route.
Interceptors are defined in the client config and can come in two versions, either built in or core:
'view' => [
'interceptors' => [
'/' => '\Ceo\Compat\Interceptors\IndexInterceptor',
'/article/*' => 'ArticleInterceptor', // to use custom interceptor
'/section/{slug}' => '\Ceo\Compat\Interceptors\SectionInterceptor',
]
]
Referencing a full namespace will load the core Interceptor, referencing a class name will cause the interceptor middleware to look in the client's "interceptors" folder for a similarly named class.
Additionally, you can use standard route placeholders to match specific routes or use the
* to match ALL routes (including bare routes) under a path.