Standardmethoden für Standort und News.Events erweitert
This commit is contained in:
@@ -14,6 +14,21 @@ class EventController {
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function showEvents() {
|
||||
$events = $this->eventModel->getEvents();
|
||||
$this->view->setVars([
|
||||
"events" => $events
|
||||
]);
|
||||
}
|
||||
|
||||
public function getEvent() {
|
||||
$ausstellungid = $_GET['ausstellungid'];
|
||||
$event = $this->eventModel->getEvent($ausstellungid);
|
||||
$this->view->setVars([
|
||||
"event" => $event
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateEvent() {
|
||||
$event = array(
|
||||
"ausstellungid" => $_POST['ausstellungid'],
|
||||
|
43
Controller/NewsController.php
Normal file
43
Controller/NewsController.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Controller;
|
||||
|
||||
use Blog\Model\NewsModel;
|
||||
|
||||
class NewsController {
|
||||
|
||||
protected $view;
|
||||
protected $newsModel;
|
||||
|
||||
public function __construct($view) {
|
||||
$this->newsModel = new NewsModel();
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function showNews() {
|
||||
$news = $this->newsModel->getNews();
|
||||
$this->view->setVars([
|
||||
"news" => $news
|
||||
]);
|
||||
}
|
||||
|
||||
public function createNews() {
|
||||
$news = [
|
||||
"name" => $_POST['name'],
|
||||
"beschreibung" => $_POST['beschreibung'],
|
||||
"datum" => $_POST['datum']
|
||||
];
|
||||
$this->newsModel->createNews($news);
|
||||
$this->view->setVars([
|
||||
"name" => $_POST['name']
|
||||
]);
|
||||
}
|
||||
|
||||
public function deleteNews() {
|
||||
$newsId = $_POST['newsid'];
|
||||
$this->newsModel->deleteNews($newsId);
|
||||
$this->view->setVars([
|
||||
"deleted" => $newsId
|
||||
]);
|
||||
}
|
||||
}
|
24
Controller/StandortController.php
Normal file
24
Controller/StandortController.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Controller;
|
||||
|
||||
use Blog\Model\StandortModel;
|
||||
|
||||
class StandortController {
|
||||
|
||||
protected $view;
|
||||
protected $standortModel;
|
||||
|
||||
public function __construct($view) {
|
||||
$this->standortModel = new StandortModel();
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function showStandorte() {
|
||||
$this -> standortModel -> getStandorte();
|
||||
$this->view->setVars([
|
||||
"standorte" => $this->standortModel->getStandorte()
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user