class Document implements Renderable

A view which renders a HTML skeleton for Flarum's frontend app.

Properties

$title <p>The title of the document, displayed in the <title> tag.</p>
$language <p>The language of the document, displayed as the value of the attribute <code>lang</code> in the <html> tag.</p>
$direction <p>The text direction of the document, displayed as the value of the attribute <code>dir</code> in the <html> tag.</p>
$appView <p>The name of the frontend app view to display.</p>
$layoutView <p>The name of the frontend layout view to display.</p>
$contentView <p>The name of the frontend content view to display.</p>
$content <p>The SEO content of the page, displayed within the layout in <noscript> tags.</p>
$payload <p>Other variables to preload into the Flarum JS.</p>
$meta <p>An array of meta tags to append to the page's <head>.</p>
$canonicalUrl <p>The canonical URL for this page.</p>
$page <p>Which page of content are we on?</p>
$hasNextPage <p>Is there a next page?</p>
$head <p>An array of strings to append to the page's <head>.</p>
$foot <p>An array of strings to prepend before the page's </body>.</p>
$js <p>An array of JavaScript URLs to load.</p>
$css <p>An array of CSS URLs to load.</p>
array $preloads <p>An array of preloaded assets.</p>
protected $versioner <p>We need the versioner to get the revisions of split chunks.</p>

Methods

__construct(Factory $view, array $forumApiDocument, ServerRequestInterface $request, TitleDriverInterface $titleDriver, Config $config, Factory $filesystem)

No description

string
render()

No description

View
makeView()

No description

string
makeTitle()

No description

View|null
makeLayout()

No description

View
makeContent()

No description

array
makePreloads()

No description

string
makeHead()

No description

string
makeJs()

No description

string
makeFoot()

No description

array
getForumApiDocument()

No description

void
setForumApiDocument(array $forumApiDocument)

No description

static string
setPageParam(string $url, int|null $page)

No description

static string
setQueryParam(string $url, string $key, string|null $value)

<p>Set or override a query param on a string URL to a particular value.</p>

Details

__construct(Factory $view, array $forumApiDocument, ServerRequestInterface $request, TitleDriverInterface $titleDriver, Config $config, Factory $filesystem)

Parameters

Factory $view
array $forumApiDocument
ServerRequestInterface $request
TitleDriverInterface $titleDriver
Config $config
Factory $filesystem

string render()

Return Value

string

protected View makeView()

Return Value

View

protected string makeTitle()

Return Value

string

protected View|null makeLayout()

Return Value

View|null

protected View makeContent()

Return Value

View

protected array makePreloads()

Return Value

array

protected string makeHead()

Return Value

string

protected string makeJs()

Return Value

string

protected string makeFoot()

Return Value

string

array getForumApiDocument()

Return Value

array

void setForumApiDocument(array $forumApiDocument)

Parameters

array $forumApiDocument

Return Value

void

static string setPageParam(string $url, int|null $page)

Parameters

string $url
int|null $page

Return Value

string

static protected string setQueryParam(string $url, string $key, string|null $value)

<p>Set or override a query param on a string URL to a particular value.</p>

Parameters

string $url
string $key
string|null $value

Return Value

string