mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
Supporting routing of URL with nothing after the discussion ID
closes flarum/core#181
This commit is contained in:
parent
e70f129330
commit
66cbbbc2c5
|
@ -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() },
|
||||
|
||||
|
|
|
@ -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')
|
||||
);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user