cms.page.display

Provides an opportunity to modify the response after the page for the URL has been processed. $result could be a string representing the HTML to be returned or it could be a Response instance.

Example usage:

Event::listen('cms.page.display', function ((\Cms\Classes\Controller) $controller, (string) $url, (\Cms\Classes\Page) $page, (mixed) $result) {
    if ($url === '/tricked-you') {
        return Response::make('Boo!', 200);
    }
});

Or

$CmsController->bindEvent('page.display', function ((string) $url, (\Cms\Classes\Page) $page, (mixed) $result) {
    if ($url === '/tricked-you') {
        return Response::make('Boo!', 200);
    }
});

Usage

Triggers

Class or file Line
Cms\Classes\Controller 247
Copyright © 2024 Winter CMS