InterceptorMiddleware
class InterceptorMiddleware extends BaseViewMiddleware
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.
Methods
Inject message output HTML. Will keep all messages contained to the same container. Can be styled via #__ceo-debug-message ID.
Handle uncached intercepter call.
Determine matched interceptor based on route.
Load interceptor via class name
Details
in BaseViewMiddleware at line 14
register()
in BaseViewMiddleware at line 25
afterRender(Event $event, $view)
in BaseViewMiddleware at line 38
string
injectMessage(string $content, string $message, boolean $newLine = true)
Inject message output HTML. Will keep all messages contained to the same container. Can be styled via #__ceo-debug-message ID.
at line 36
handle($event, $view)
Handle uncached intercepter call.
at line 78
string
getMatchedInterceptor()
Determine matched interceptor based on route.
at line 122
object
loadInterceptor(string $matchedInterceptor)
Load interceptor via class name