aktuelle.kurse/m133/4_Modulinhalte_und_Uebungen/00-Anwendungen-Beispiele-Uebungen/mvc/controller/Controller.php
Harald G. Mueller 28ff49e098 muh
2023-06-29 07:50:41 +02:00

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';
}
}
}
?>