Created
June 5, 2019 02:13
-
-
Save hissy/b6a35dfe4b88e544a928c5bf667e4445 to your computer and use it in GitHub Desktop.
#concrete5 Switch theme via request path for page not found
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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