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:
parent
7796580210
commit
479e44dd04
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ abstract class AbstractWebApp
|
||||
*/
|
||||
protected function getLayout()
|
||||
{
|
||||
return __DIR__.'/../../../views/'.$this->getName().'.blade.php';
|
||||
return 'flarum::frontend.'.$this->getName();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user