mirror of
https://github.com/flarum/core.git
synced 2025-08-19 23:01:56 +02:00
Remove "custom" home page input
Also add an API to let extensions define additional default route options. Allowing default routes with parameters (e.g. /d/123) is very difficult because of the way Mithril routing works, and it doesn't have a convincing use-case to justify the trouble. So I've removed the custom input altogether. closes #427
This commit is contained in:
@@ -63,7 +63,7 @@ class ForumServiceProvider extends ServiceProvider
|
||||
$routes->get(
|
||||
'/all',
|
||||
'flarum.forum.index',
|
||||
$this->action('Flarum\Forum\Actions\IndexAction')
|
||||
$defaultAction = $this->action('Flarum\Forum\Actions\IndexAction')
|
||||
);
|
||||
|
||||
$routes->get(
|
||||
@@ -129,11 +129,16 @@ class ForumServiceProvider extends ServiceProvider
|
||||
event(new RegisterForumRoutes($routes));
|
||||
|
||||
$settings = $this->app->make('Flarum\Core\Settings\SettingsRepository');
|
||||
$defaultRoute = $settings->get('default_route');
|
||||
|
||||
if (isset($routes->getRouteData()[0]['GET'][$defaultRoute])) {
|
||||
$defaultAction = $routes->getRouteData()[0]['GET'][$defaultRoute];
|
||||
}
|
||||
|
||||
$routes->get(
|
||||
'/',
|
||||
'flarum.forum.default',
|
||||
$routes->getRouteData()[0]['GET'][$settings->get('default_route')]
|
||||
$defaultAction
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user