Created
September 11, 2015 01:54
-
-
Save tobyzerner/19f34dcab33bafd66e4d to your computer and use it in GitHub Desktop.
Flarum Custom Layout Extension
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 | |
namespace Flarum\CustomLayout; | |
use Flarum\Support\Extension as BaseExtension; | |
use Illuminate\Events\Dispatcher; | |
use Flarum\Events\BuildClientView; | |
use Flarum\Forum\Actions\ClientAction as ForumClientAction; | |
class Extension extends BaseExtension | |
{ | |
public function listen(Dispatcher $events) | |
{ | |
$events->listen(BuildClientView::class, function (BuildClientView $event) { | |
if ($event->action instanceof ForumClientAction) { | |
$event->view->setLayout(__DIR__.'/forum.blade.php'); | |
} | |
}); | |
} | |
} | |
return Extension::class; |
pryley
commented
Apr 6, 2018
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment