www.gusucode.com > Flarum PHP论坛 中文版 v0.1 beta7源码程序 > FlarumChina-master/vendor/flarum/flarum-ext-subscriptions/src/Listener/AddClientAssets.php
<?php /* * This file is part of Flarum. * * (c) Toby Zerner <toby.zerner@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Flarum\Subscriptions\Listener; use Flarum\Event\ConfigureWebApp; use Illuminate\Contracts\Events\Dispatcher; class AddClientAssets { /** * @param Dispatcher $events */ public function subscribe(Dispatcher $events) { $events->listen(ConfigureWebApp::class, [$this, 'addAssets']); } /** * @param ConfigureClientView $event */ public function addAssets(ConfigureWebApp $event) { if ($event->isForum()) { $event->addAssets([ __DIR__.'/../../js/forum/dist/extension.js', __DIR__.'/../../less/forum/extension.less' ]); $event->addBootstrapper('flarum/subscriptions/main'); } } }