mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-05-21 05:40:47 +00:00
93d3aa56a1
Sometimes variables may be null. Handle the cases when passing to functions expecting something non-null.
34 lines
1.0 KiB
PHP
34 lines
1.0 KiB
PHP
<?php
|
|
namespace ScummVM\Pages;
|
|
|
|
use ScummVM\Controller;
|
|
use ScummVM\Models\DownloadsModel;
|
|
|
|
class DownloadsPage extends Controller
|
|
{
|
|
private DownloadsModel $downloadsModel;
|
|
/* Constructor. */
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->template = 'pages/downloads.tpl';
|
|
$this->downloadsModel = new DownloadsModel();
|
|
}
|
|
|
|
/* Display the index page. */
|
|
public function index(): void
|
|
{
|
|
$downloads = $this->downloadsModel->getAllDownloads();
|
|
$recommendedDownload = $this->downloadsModel->getRecommendedDownload();
|
|
$this->renderPage(
|
|
array(
|
|
'title' => $this->getConfigVars('downloadsTitle'),
|
|
'description' => \strip_tags($this->getConfigVars('downloadsContentP1') ?? ''),
|
|
'content_title' => $this->getConfigVars('downloadsContentTitle'),
|
|
'downloads' => $downloads,
|
|
'recommendedDownload' => $recommendedDownload
|
|
)
|
|
);
|
|
}
|
|
}
|