Files
Mataniko 4471b291a1 WEB: Convert all models to not be static objects
This is a first step towards moving to a dependency injection model.
2020-09-27 22:08:07 -04:00

32 lines
758 B
PHP

<?php
namespace ScummVM\Pages;
use ScummVM\Controller;
use ScummVM\Models\GameDemosModel;
class DemosPage extends Controller
{
private $gameDemosModel;
/* Constructor. */
public function __construct()
{
parent::__construct();
$this->template = 'pages/game_demos.tpl';
$this->gameDemosModel = new GameDemosModel();
}
/* Display the index page. */
public function index()
{
$demos = $this->gameDemosModel->getAllGroupsAndDemos();
return $this->renderPage(
array(
'title' => $this->getConfigVars('demosTitle'),
'content_title' => $this->getConfigVars('demosContentTitle'),
'demos' => $demos,
)
);
}
}