EventController, TicketController + Model + essenzielle Funktionen
This commit is contained in:
@@ -13,14 +13,12 @@ class ContactController
|
||||
private $labels = array("name" => "Name", "email" => "E-Mail-Adresse", "content" => "Nachricht");
|
||||
|
||||
|
||||
public function __construct($view)
|
||||
{
|
||||
public function __construct($view) {
|
||||
$this->db = new ContactModel();
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function showContactForm()
|
||||
{
|
||||
public function showContactForm() {
|
||||
$this->view->setVars([
|
||||
'labels' => $this->labels,
|
||||
'validData' => $this->validData,
|
||||
@@ -28,12 +26,11 @@ class ContactController
|
||||
]);
|
||||
}
|
||||
|
||||
public function showConfirmation()
|
||||
{
|
||||
public function showConfirmation() {
|
||||
|
||||
}
|
||||
|
||||
public function validateForm(){
|
||||
public function validateForm() {
|
||||
foreach ($this->labels as $index => $value) {
|
||||
if (!isset($_POST[$index]) || empty($_POST[$index])) {
|
||||
$this->errors[$index] = "Bitte " . $value . " angeben";
|
||||
|
Reference in New Issue
Block a user