class DiscussionController extends ClientController

Properties

protected $clientName <p>{@inheritdoc}</p> from ClientController
protected string $layout <p>The name of the view to include as the page layout.</p> from AbstractClientController
protected $translations <p>{@inheritdoc}</p> from ClientController
protected Application $app from AbstractClientController
protected Client $api from AbstractClientController
protected LocaleManager $locales from AbstractClientController
protected SettingsRepositoryInterface $settings from AbstractClientController
protected Dispatcher $events from AbstractClientController
protected Repository $cache from AbstractClientController
protected Formatter $formatter from ClientController

Methods

ResponseInterface
handle(ServerRequestInterface $request)

No description

Renderable
render(ServerRequestInterface $request)

No description

__construct(Application $app, Client $api, LocaleManager $locales, SettingsRepositoryInterface $settings, Dispatcher $events, Repository $cache, Formatter $formatter)

No description

flushAssets()

<p>Flush the client's assets so that they will be regenerated from scratch on the next render.</p>

flushCss()

No description

flushJs()

No description

flushLocales()

No description

getAssets()

No description

addAssets(AssetManager $assets)

<p>Add the assets necessary to boot a Flarum client, found within the directory specified by the $clientName property.</p>

addCustomizations(AssetManager $assets)

<p>Add any configured JS/LESS customizations to the asset manager.</p>

array
getLessVariables()

<p>Get the values of any LESS variables to compile into the CSS, based on the forum's configuration.</p>

getLocaleCompiler(string $locale)

<p>Set up the locale compiler for the given locale.</p>

string
getAssetDirectory()

<p>Get the path to the directory where assets should be written.</p>

array
filterTranslations(array $translations)

<p>Take a selection of keys from a collection of translations.</p>

object
preload(User $actor, array $params)

<p>Get the result of an API request to show a discussion.</p>

Details

ResponseInterface handle(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

ResponseInterface

Renderable render(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

Renderable

__construct(Application $app, Client $api, LocaleManager $locales, SettingsRepositoryInterface $settings, Dispatcher $events, Repository $cache, Formatter $formatter)

Parameters

Application $app
Client $api
LocaleManager $locales
SettingsRepositoryInterface $settings
Dispatcher $events
Repository $cache
Formatter $formatter

flushAssets()

<p>Flush the client's assets so that they will be regenerated from scratch on the next render.</p>

protected AssetManager getAssets()

Return Value

AssetManager

protected addAssets(AssetManager $assets)

<p>Add the assets necessary to boot a Flarum client, found within the directory specified by the $clientName property.</p>

Parameters

AssetManager $assets

protected addCustomizations(AssetManager $assets)

<p>Add any configured JS/LESS customizations to the asset manager.</p>

Parameters

AssetManager $assets

protected array getLessVariables()

<p>Get the values of any LESS variables to compile into the CSS, based on the forum's configuration.</p>

Return Value

array

protected JsCompiler getLocaleCompiler(string $locale)

<p>Set up the locale compiler for the given locale.</p>

Parameters

string $locale

Return Value

JsCompiler

protected string getAssetDirectory()

<p>Get the path to the directory where assets should be written.</p>

Return Value

string

protected array filterTranslations(array $translations)

<p>Take a selection of keys from a collection of translations.</p>

Parameters

array $translations

Return Value

array

protected object preload(User $actor, array $params)

<p>Get the result of an API request to show a discussion.</p>

Parameters

User $actor
array $params

Return Value

object

Exceptions

RouteNotFoundException