mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 07:11:56 +08:00
ForumSerializer: Use UrlGenerator for base URLs
The test from the previous commit proves this works as intended. :) This is one more step in trying to avoid the widespread usage of the `Application` godclass. Refs #2055.
This commit is contained in:
parent
8c19ba1aaa
commit
cd9edf656b
@ -64,10 +64,10 @@ class ForumSerializer extends AbstractSerializer
|
||||
'title' => $this->settings->get('forum_title'),
|
||||
'description' => $this->settings->get('forum_description'),
|
||||
'showLanguageSelector' => (bool) $this->settings->get('show_language_selector', true),
|
||||
'baseUrl' => $url = $this->app->url(),
|
||||
'baseUrl' => $url = $this->url->to('forum')->base(),
|
||||
'basePath' => parse_url($url, PHP_URL_PATH) ?: '',
|
||||
'debug' => $this->app->inDebugMode(),
|
||||
'apiUrl' => $this->app->url('api'),
|
||||
'apiUrl' => $this->url->to('api')->base(),
|
||||
'welcomeTitle' => $this->settings->get('welcome_title'),
|
||||
'welcomeMessage' => $this->settings->get('welcome_message'),
|
||||
'themePrimaryColor' => $this->settings->get('theme_primary_color'),
|
||||
@ -84,7 +84,7 @@ class ForumSerializer extends AbstractSerializer
|
||||
];
|
||||
|
||||
if ($this->actor->can('administrate')) {
|
||||
$attributes['adminUrl'] = $this->app->url('admin');
|
||||
$attributes['adminUrl'] = $this->url->to('admin')->base();
|
||||
$attributes['version'] = $this->app->version();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user