Files
scummvm-web/include/Pages/PressSnowberryPage.php
Mataniko db6cb726e8 WEB: Add a new SimpleModel class
The SimpleModel is used to to read simple data models from YAML that require no further processing

This allows us to delete several models that re-use the same code.
2020-09-27 22:08:07 -04:00

32 lines
814 B
PHP

<?php
namespace ScummVM\Pages;
use ScummVM\Controller;
use ScummVM\Models\SimpleModel;
class PressSnowberryPage extends Controller
{
private $articleModel;
/* Constructor. */
public function __construct()
{
parent::__construct();
$this->template = 'pages/press_snowberry.tpl';
$this->articleModel = new SimpleModel("Article", "press_articles.yaml");
}
/* Display the index page. */
public function index()
{
$articles = $this->articleModel->getAllData(false);
return $this->renderPage(
array(
'title' => $this->getConfigVars('pressSnowberryTitle'),
'content_title' => $this->getConfigVars('pressSnowberryContentTitle'),
'articles' => $articles,
)
);
}
}