cms.page.beforeRenderContent

Provides an opportunity to manipulate the name of the content file being rendered before it renders

Example usage:

Event::listen('cms.page.beforeRenderContent', function ((\Cms\Classes\Controller) $controller, (string) $contentName) {
    return Cms\Classes\Content::loadCached($theme, 'custom-content-name');
});

Or

$CmsController->bindEvent('page.beforeRenderContent', function ((string) $contentName) {
    return Cms\Classes\Content::loadCached($theme, 'custom-content-name');
});

Usage

Triggers

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