Update extension stub with new APIs

This commit is contained in:
Toby Zerner 2015-06-23 10:37:01 +09:30
parent c2883bc85e
commit 7a05f71987

View File

@ -1,9 +1,7 @@
<?php namespace {{namespace}}; <?php namespace {{namespace}};
use Flarum\Support\ServiceProvider; use Flarum\Support\ServiceProvider;
use Flarum\Extend\ForumAssets; use Flarum\Extend;
use Flarum\Extend\Locale;
use Flarum\Extend\ForumTranslations;
class {{classPrefix}}ServiceProvider extends ServiceProvider class {{classPrefix}}ServiceProvider extends ServiceProvider
{ {
@ -14,19 +12,19 @@ class {{classPrefix}}ServiceProvider extends ServiceProvider
*/ */
public function boot() public function boot()
{ {
$this->extend( $this->extend([
new ForumAssets([ (new Extend\Locale('en'))->translations(__DIR__.'/../locale/en.yml'),
__DIR__.'/../js/dist/extension.js',
__DIR__.'/../less/extension.less'
]),
(new Locale('en'))->translations(__DIR__.'/../locale/en.yml'), (new Extend\ForumClient())
->assets([
new ForumTranslations([ __DIR__.'/../js/dist/extension.js',
// Add the keys of translations you would like to be available __DIR__.'/../less/extension.less'
// for use by the JS client application. ])
]), ->translations([
); // Add the keys of translations you would like to be available
// for use by the JS client application.
])
]);
} }
/** /**