Added News page

This commit is contained in:
amikhaylov
2026-05-15 13:56:57 +03:00
parent 18a843b710
commit 4886612f7f
9 changed files with 172 additions and 4 deletions
+1 -2
View File
@@ -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'));
+26
View File
@@ -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'));
}
}