Supporting routing of URL with nothing after the discussion ID

closes flarum/core#181
This commit is contained in:
Toby Zerner 2015-07-28 13:46:43 +09:30
parent e70f129330
commit 66cbbbc2c5
3 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,7 @@ export default function(app) {
'index': { path: '/', component: IndexPage.component() },
'index.filter': { path: '/:filter', component: IndexPage.component() },
'discussion.id': { path: '/d/:id', component: DiscussionPage.component() },
'discussion': { path: '/d/:id/:slug', component: DiscussionPage.component() },
'discussion.near': { path: '/d/:id/:slug/:near', component: DiscussionPage.component() },

View File

@ -59,7 +59,7 @@ class ForumServiceProvider extends ServiceProvider
);
$routes->get(
'/d/{id:\d+}/{slug}[/{near}]',
'/d/{id:\d+}[/{slug}[/{near}]]',
'flarum.forum.discussion',
$this->action('Flarum\Forum\Actions\DiscussionAction')
);

View File

@ -71,6 +71,7 @@ abstract class ClientAction extends HtmlAction
/**
* @param Client $apiClient
* @param LocaleManager $locales
* @param SettingsRepository $settings
*/
public function __construct(Client $apiClient, LocaleManager $locales, SettingsRepository $settings)
{