mirror of
https://github.com/flarum/framework.git
synced 2024-11-22 12:10:10 +08:00
fix: add view namespaces before resolving
Allows `replaceNamespace()` extender to actually remove old routes.
This commit is contained in:
parent
256ba64a40
commit
3d46ead14b
|
@ -29,6 +29,7 @@ use Flarum\Locale\LocaleManager;
|
|||
use Flarum\Settings\Event\Saved;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Laminas\Stratigility\MiddlewarePipe;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
|
||||
class AdminServiceProvider extends AbstractServiceProvider
|
||||
{
|
||||
|
@ -121,9 +122,9 @@ class AdminServiceProvider extends AbstractServiceProvider
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function boot()
|
||||
public function boot(ViewFactory $views)
|
||||
{
|
||||
$this->loadViewsFrom(__DIR__.'/../../views', 'flarum.admin');
|
||||
$views->addNamespace('flarum.admin', __DIR__.'/../../views');
|
||||
|
||||
$events = $this->container->make('events');
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ use Flarum\Settings\Event\Saving;
|
|||
use Flarum\Settings\SettingsRepositoryInterface;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Laminas\Stratigility\MiddlewarePipe;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
|
@ -131,11 +131,11 @@ class ForumServiceProvider extends AbstractServiceProvider
|
|||
});
|
||||
}
|
||||
|
||||
public function boot(Container $container, Dispatcher $events, Factory $view)
|
||||
public function boot(Container $container, Dispatcher $events, ViewFactory $views)
|
||||
{
|
||||
$this->loadViewsFrom(__DIR__.'/../../views', 'flarum.forum');
|
||||
$views->addNamespace('flarum.forum', __DIR__.'/../../views');
|
||||
|
||||
$view->share([
|
||||
$views->share([
|
||||
'translator' => $container->make(TranslatorInterface::class),
|
||||
'settings' => $container->make(SettingsRepositoryInterface::class)
|
||||
]);
|
||||
|
|
|
@ -144,7 +144,7 @@ class FrontendServiceProvider extends AbstractServiceProvider
|
|||
*/
|
||||
public function boot(Container $container, ViewFactory $views)
|
||||
{
|
||||
$this->loadViewsFrom(__DIR__.'/../../views', 'flarum');
|
||||
$views->addNamespace('flarum', __DIR__.'/../../views');
|
||||
|
||||
$views->share([
|
||||
'translator' => $container->make('translator'),
|
||||
|
|
|
@ -13,6 +13,7 @@ use Flarum\Foundation\AbstractServiceProvider;
|
|||
use Flarum\Http\RouteCollection;
|
||||
use Flarum\Http\RouteHandlerFactory;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
|
||||
class InstallServiceProvider extends AbstractServiceProvider
|
||||
{
|
||||
|
@ -29,9 +30,9 @@ class InstallServiceProvider extends AbstractServiceProvider
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function boot(Container $container, RouteHandlerFactory $route)
|
||||
public function boot(Container $container, RouteHandlerFactory $route, ViewFactory $views)
|
||||
{
|
||||
$this->loadViewsFrom(__DIR__.'/../../views/install', 'flarum.install');
|
||||
$views->addNamespace('flarum.install', __DIR__.'/../../views/install');
|
||||
|
||||
$this->populateRoutes($container->make('flarum.install.routes'), $route);
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ use Flarum\Foundation\AbstractServiceProvider;
|
|||
use Flarum\Http\RouteCollection;
|
||||
use Flarum\Http\RouteHandlerFactory;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
|
||||
class UpdateServiceProvider extends AbstractServiceProvider
|
||||
{
|
||||
|
@ -30,9 +31,9 @@ class UpdateServiceProvider extends AbstractServiceProvider
|
|||
});
|
||||
}
|
||||
|
||||
public function boot()
|
||||
public function boot(ViewFactory $views)
|
||||
{
|
||||
$this->loadViewsFrom(__DIR__.'/../../views/install', 'flarum.update');
|
||||
$views->addNamespace('flarum.update', __DIR__ . '/../../views/install');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user