1
0
mirror of https://github.com/flarum/core.git synced 2025-10-10 14:34:30 +02:00

Allow customisation of the client layout

This commit is contained in:
Toby Zerner
2015-07-27 14:45:35 +09:30
parent e257454343
commit 3489791932
3 changed files with 18 additions and 4 deletions

View File

@@ -41,7 +41,7 @@ class ClientView implements Renderable
protected $content;
/**
* The name of the client layout view to display.
* The path to the client layout view to display.
*
* @var string
*/
@@ -143,6 +143,16 @@ class ClientView implements Renderable
$this->content = $content;
}
/**
* Set the name of the client layout view to display.
*
* @param string $layout
*/
public function setLayout($layout)
{
$this->layout = $layout;
}
/**
* Add a string to be appended to the page's <head>.
*
@@ -205,7 +215,7 @@ class ClientView implements Renderable
$view->title = ($this->title ? $this->title . ' - ' : '') . $forum->data->attributes->title;
$view->document = $this->document;
$view->forum = $forum->data;
$view->layout = $this->layout;
$view->layout = app('view')->file($this->layout, ['forum' => $forum->data]);
$view->content = $this->content;
$view->styles = [$this->assets->getCssFile()];