mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-05-21 05:40:47 +00:00
db6cb726e8
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.
32 lines
777 B
PHP
32 lines
777 B
PHP
<?php
|
|
namespace ScummVM\Pages;
|
|
|
|
use ScummVM\Controller;
|
|
use ScummVM\Models\SimpleModel;
|
|
|
|
class PressPage extends Controller
|
|
{
|
|
private $articleModel;
|
|
|
|
/* Constructor. */
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->template = 'pages/press.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('pressTitle'),
|
|
'content_title' => $this->getConfigVars('pressContentTitle'),
|
|
'articles' => $articles,
|
|
)
|
|
);
|
|
}
|
|
}
|