aktuelle.kurse/old_m133/Modul_Unterlagen_133_VOR/01-Modulinhalte/01 WEB Architektur/OO MVC/mvc/controller/Controller.php
Müller Harald 507e5da390 muh
2022-05-13 11:53:50 +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';
}
}
}
?>