Added News page
This commit is contained in:
@@ -9,13 +9,12 @@ class GigsController extends Controller
|
||||
public function __construct(
|
||||
private GigsLoader $loader,
|
||||
) {
|
||||
|
||||
$this->addCssFile('gigs.css');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$events = $this->loader->getEvents();
|
||||
$this->addCssFile('gigs.css');
|
||||
|
||||
return $this->render('gigs')
|
||||
->with(compact('events'));
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Loaders\NewsLoader;
|
||||
use App\Views\NewsView;
|
||||
|
||||
class NewsController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private NewsLoader $newsLoader,
|
||||
private NewsView $view,
|
||||
) {
|
||||
$this->addCssFile('news.css');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$news = $this->newsLoader->getNews();
|
||||
$this->view->prepareData($news);
|
||||
|
||||
|
||||
return $this->render('news')
|
||||
->with(compact('news'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user