mirror of
https://github.com/flarum/framework.git
synced 2025-01-07 19:13:37 +08:00
Update extension stub with new APIs
This commit is contained in:
parent
c2883bc85e
commit
7a05f71987
|
@ -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'),
|
||||||
|
|
||||||
|
(new Extend\ForumClient())
|
||||||
|
->assets([
|
||||||
__DIR__.'/../js/dist/extension.js',
|
__DIR__.'/../js/dist/extension.js',
|
||||||
__DIR__.'/../less/extension.less'
|
__DIR__.'/../less/extension.less'
|
||||||
]),
|
])
|
||||||
|
->translations([
|
||||||
(new Locale('en'))->translations(__DIR__.'/../locale/en.yml'),
|
|
||||||
|
|
||||||
new ForumTranslations([
|
|
||||||
// Add the keys of translations you would like to be available
|
// Add the keys of translations you would like to be available
|
||||||
// for use by the JS client application.
|
// for use by the JS client application.
|
||||||
]),
|
])
|
||||||
);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user