mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-11-27 20:21:56 +01:00
30 lines
514 B
PHP
30 lines
514 B
PHP
<?php
|
|
include_once("model/Model.php");
|
|
|
|
class Controller {
|
|
public $model;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->model = new Model();
|
|
|
|
}
|
|
|
|
public function invoke()
|
|
{
|
|
if (!isset($_GET['book']))
|
|
{
|
|
// no special book is requested, we'll show a list of all available books
|
|
$books = $this->model->getBookList();
|
|
include 'view/booklist.php';
|
|
}
|
|
else
|
|
{
|
|
// show the requested book
|
|
$book = $this->model->getBook($_GET['book']);
|
|
include 'view/viewbook.php';
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|