1
0
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:
Toby Zerner
2015-09-17 12:56:39 +09:30
parent e038c5c9d9
commit dbd33f687c
3 changed files with 37 additions and 18 deletions

View File

@@ -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
);
}