-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
44 lines (28 loc) · 886 Bytes
/
index.php
File metadata and controls
44 lines (28 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require 'vendor/autoload.php';
use Config\Database\DBConfig as DB;
//Połączenie z bazą danych
Config\Database\DBConnection::setDBConnection(
DB::$user,DB::$password,
DB::$hostname, DB::$databaseType, DB::$port);
\Config\Website\Config::$subdir = 'Projekt_Zespolowy/';
//Inicjalizacja sesji anonimowej
\Tools\Session::initialize();
//Kontroler/akcja/parametr_id
if(isset($_GET['controller']))
$controller = $_GET['controller'];
else
$controller = 'Strona';
if(isset($_GET['action']))
$action = $_GET['action'];
else
$action = 'getAll';
if(isset($_GET['id']))
$id = $_GET['id'];
else
$id = null;
$controller = 'Controllers\\'.$controller;
//tworzymy kontroler
$mycontroller = new $controller();
//wykonujemy akcję dla kontrolera
$mycontroller->$action($id);