1
0
mirror of https://github.com/flarum/core.git synced 2025-01-17 22:29:15 +01:00

Restructure views

- Use Laravel's view namespacing rather than the full file path
- Organise views into directories
This commit is contained in:
Toby Zerner 2017-11-29 12:49:09 +10:30
parent 7796580210
commit 479e44dd04
10 changed files with 6 additions and 6 deletions

View File

@ -87,7 +87,7 @@ class DiscussionController extends WebAppController
$view->title = $document->data->attributes->title;
$view->document = $document;
$view->content = app('view')->make('flarum.forum::discussion', compact('document', 'page', 'getResource', 'posts', 'url'));
$view->content = app('view')->make('flarum::frontend.content.discussion', compact('document', 'page', 'getResource', 'posts', 'url'));
return $view;
}

View File

@ -68,7 +68,7 @@ class IndexController extends WebAppController
$document = $this->getDocument($request->getAttribute('actor'), $params);
$view->document = $document;
$view->content = app('view')->make('flarum.forum::index', compact('document', 'page', 'forum'));
$view->content = app('view')->make('flarum::frontend.content.index', compact('document', 'page', 'forum'));
return $view;
}

View File

@ -86,7 +86,7 @@ abstract class AbstractWebApp
*/
protected function getLayout()
{
return __DIR__.'/../../../views/'.$this->getName().'.blade.php';
return 'flarum::frontend.'.$this->getName();
}
/**

View File

@ -287,7 +287,7 @@ class WebAppView
$this->view->share('forum', array_get($forum, 'data'));
$this->view->share('debug', $this->app->inDebugMode());
$view = $this->view->file(__DIR__.'/../../../views/app.blade.php');
$view = $this->view->make('flarum::frontend.app');
$view->title = $this->buildTitle(array_get($forum, 'data.attributes.title'));
$view->description = $this->description ?: array_get($forum, 'data.attributes.description');
@ -336,7 +336,7 @@ class WebAppView
protected function buildLayout()
{
$view = $this->view->file($this->layout);
$view = $this->view->make($this->layout);
$view->content = $this->buildContent();
@ -345,7 +345,7 @@ class WebAppView
protected function buildContent()
{
$view = $this->view->file(__DIR__.'/../../../views/content.blade.php');
$view = $this->view->make('flarum::frontend.content');
$view->content = $this->content;