FEATURE #1427: add homepage functionality.

Displaying homepage now depends on module handler
This commit is contained in:
Michal Kváček
2016-02-17 13:24:16 +01:00
parent 6d0e6e26f6
commit 37a698b631
15 changed files with 329 additions and 38 deletions
+20 -4
View File
@@ -9,11 +9,28 @@ use Illuminate\Support\Facades\Auth;
class ContentPage extends Controller
{
/**
* @var Content
*/
protected $content;
/**
* @param Content $content
*/
function __construct(Content $content)
{
$this->content = $content;
}
public function getPage($url)
{
$page = Content::where('url', $url)
->where('status', '!=', Content::STATUS_DELETED)
->first();
$page = $this->content->getByURL($url);
// no page available
if (!$page) {
abort(404);
}
return $this->renderPage($page);
}
@@ -38,6 +55,5 @@ class ContentPage extends Controller
// render page
return $handler->render($page, '');
// return call_user_func([$handler, 'render'], $page);
}
}