1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 21:50:50 +02:00

Update extension skeleton

Closes #743.
This commit is contained in:
Franz Liedke
2016-01-20 22:13:55 +01:00
parent c99c83435b
commit e0790de2e5
5 changed files with 42 additions and 91 deletions

View File

@@ -1,10 +1,14 @@
<?php
// Require the extension's composer autoload file. This will enable all of our
// classes in the src directory to be autoloaded.
require __DIR__.'/vendor/autoload.php';
use Illuminate\Contracts\Events\Dispatcher;
use {{namespace}}\Listener;
// Return the name of our Extension class. Flarum will register it as a service
// provider, allowing it to register bindings and execute code when the
// application boots.
return '{{namespace}}\Extension';
// Return a function that registers the extension with Flarum. This is
// the place to listen to events, register bindings with the container
// and execute code when the application boots.
//
// Any typehinted argument of this function is automatically resolved
// by the IoC container.
return function (Dispatcher $events) {
$events->subscribe(Listener\AddClientAssets::class);
};