Skip to content

Instantly share code, notes, and snippets.

@hissy hissy/app.php
Created Jun 5, 2019

Embed
What would you like to do?
#concrete5 Switch theme via request path for page not found
<?php
// Tested on 8.5.2a1
Events::addListener('on_before_render', function ($event) {
$view = $event->getArgument('view');
if ($view->getViewPath() == '/page_not_found') {
$request = \Request::getInstance();
if ($request->getPath() == '/foo' || $request->matches('/foo/*')) {
$view->setViewTheme('concrete');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.