Files
scummvm-web/include/Pages/GamesPage.php
T
Le Philousophe 93d3aa56a1 WEB: Handle null cases
Sometimes variables may be null. Handle the cases when passing to
functions expecting something non-null.
2025-08-24 12:32:47 +02:00

33 lines
889 B
PHP

<?php
namespace ScummVM\Pages;
use ScummVM\Controller;
use ScummVM\Models\GameDownloadsModel;
class GamesPage extends Controller
{
private GameDownloadsModel $gameDownloadsModel;
/* Constructor. */
public function __construct()
{
parent::__construct();
$this->template = 'pages/games.tpl';
$this->gameDownloadsModel = new GameDownloadsModel();
}
/* Display the index page. */
public function index(): void
{
$downloads = $this->gameDownloadsModel->getAllDownloads();
$this->renderPage(
array(
'title' => $this->getConfigVars('gamesTitle'),
'description' => strip_tags($this->getConfigVars('gamesContentP1') ?? ''),
'content_title' => $this->getConfigVars('gamesContentTitle'),
'downloads' => $downloads,
)
);
}
}