\Ceo\View\MiddlewareInterceptorMiddleware

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.

Summary

Methods
Properties
Constants
register()
afterRender()
injectMessage()
handle()
getMatchedInterceptor()
loadInterceptor()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
transformAnyFilter()
No private properties found
N/A

Methods

register()

register() 

afterRender()

afterRender(\Phalcon\Events\Event  $event,   $view) 

Parameters

\Phalcon\Events\Event $event
$view

injectMessage()

injectMessage(  $content,   $message,   $newLine = true) : string

Inject message output HTML. Will keep all messages contained to the same container. Can be styled via #__ceo-debug-message ID.

Parameters

$content
$message
$newLine

Returns

string —

output content

handle()

handle(  $event,   $view) 

Handle uncached intercepter call.

Parameters

$event
$view

getMatchedInterceptor()

getMatchedInterceptor() : string

Determine matched interceptor based on route.

Returns

string —

matched interceptor class name

loadInterceptor()

loadInterceptor(  $matchedInterceptor) : object

Load interceptor via class name

Parameters

$matchedInterceptor

Returns

object —

Interceptor

transformAnyFilter()

transformAnyFilter(  $route) : string

Stars will match any route within the scheme.

Parameters

$route

Returns

string