FEATURE #1427: add homepage functionality.
Displaying homepage now depends on module handler
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user