Webseite ohne Anmeldung läuft auf laravel
This commit is contained in:
36
M5/Dossier/emensa/controllers/DemoController.php
Normal file
36
M5/Dossier/emensa/controllers/DemoController.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/../models/gericht.php');
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/../models/kategorie.php');
|
||||
|
||||
class DemoController
|
||||
{
|
||||
public function dbconnect() {
|
||||
$data = db_gericht_select_all();
|
||||
// Frage Daten aus kategorie ab:
|
||||
// $data = db_kategorie_select_all();
|
||||
return view('demo.dbdata', ['data' => $data]);
|
||||
}
|
||||
|
||||
public function demo(RequestData $rd) {
|
||||
$vars = [
|
||||
'bgcolor' => $rd->query['bgcolor'] ?? 'ffffff',
|
||||
'name' => $rd->query['name'] ?? 'Dich',
|
||||
'rd' => $rd
|
||||
];
|
||||
return view('demo.demo', $vars);
|
||||
}
|
||||
|
||||
/**
|
||||
* error action for debug purposes
|
||||
* @throws Exception
|
||||
* @noinspection PhpUnusedLocalVariableInspection
|
||||
*/
|
||||
public function error(RequestData $rd) {
|
||||
$test = $rd;
|
||||
throw new Exception("Not implemented");
|
||||
}
|
||||
|
||||
public function requestdata(RequestData $rd) {
|
||||
return view('demo.requestdata', ['rd' => $rd]);
|
||||
}
|
||||
}
|
||||
47
M5/Dossier/emensa/controllers/ExampleController.php
Normal file
47
M5/Dossier/emensa/controllers/ExampleController.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/../models/kategorie.php');
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/../models/gerichte_self.php');
|
||||
|
||||
class ExampleController
|
||||
{
|
||||
public function m4_6a_queryparameter(RequestData $rd) {
|
||||
/*
|
||||
Wenn Sie hier landen:
|
||||
bearbeiten Sie diese Action,
|
||||
so dass Sie die Aufgabe löst
|
||||
*/
|
||||
$rd = $rd->query['name'] ?? 'Kein Name angegeben';
|
||||
|
||||
return view('examples.m4_7a_queryparameter', [
|
||||
'request'=>$rd,
|
||||
'url' => 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function m4_7b_kategorie() {
|
||||
$data = db_kategorie_select_all();
|
||||
|
||||
return view('examples.m4_7b_kategorie', [
|
||||
'data'=>$data,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function m4_7c_gerichte() {
|
||||
$data = db_gericht_select_intern();
|
||||
|
||||
return view('examples.m4_7c_gerichte', [
|
||||
'data'=>$data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function m4_7d(RequestData $rd) {
|
||||
|
||||
$rd = $rd->query['no'] ?? 1;
|
||||
if ($rd == 1)
|
||||
return view('examples.pages.m4_7d_page_1', []);
|
||||
elseif ($rd == 2)
|
||||
return view('examples.pages.m4_7d_page_2', []);
|
||||
}
|
||||
}
|
||||
14
M5/Dossier/emensa/controllers/HomeController.php
Normal file
14
M5/Dossier/emensa/controllers/HomeController.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/../models/gericht.php');
|
||||
|
||||
/* Datei: controllers/HomeController.php */
|
||||
class HomeController
|
||||
{
|
||||
public function index(RequestData $request) {
|
||||
return view('home', ['rd' => $request ]);
|
||||
}
|
||||
|
||||
public function debug(RequestData $request) {
|
||||
return view('debug');
|
||||
}
|
||||
}
|
||||
23
M5/Dossier/emensa/controllers/MainController.php
Normal file
23
M5/Dossier/emensa/controllers/MainController.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/../models/gerichte_main.php');
|
||||
|
||||
class MainController
|
||||
{
|
||||
public function index() {
|
||||
/*
|
||||
Wenn Sie hier landen:
|
||||
bearbeiten Sie diese Action,
|
||||
so dass Sie die Aufgabe löst
|
||||
*/
|
||||
|
||||
|
||||
|
||||
$data = db_gericht_select_karte();
|
||||
|
||||
return view('main.index', [
|
||||
'data'=>$data,
|
||||
'url' => 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user