mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 09:45:33 +00:00
project structure refactoring
This commit is contained in:
1 parent
d137d08ff4
commit
e75de72afd
52 files changed
-31
No files matched your search
@@ -142,7 +142,6 @@ Project Link: [https://github.com/GamerClassN7/Smart_Home/](https://github.com/G
|
||||
- /controllers
|
||||
- UserController.php
|
||||
- /library # helpers etc.
|
||||
- Mailer.php
|
||||
- /models
|
||||
- /types
|
||||
- Units.php
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
class Route{
|
||||
private $urls = [];
|
||||
private $views = [];
|
||||
|
||||
function __construct() {
|
||||
// code...
|
||||
}
|
||||
|
||||
function add($url, $view = "", $conrol = "") {
|
||||
$this->urls[] = '/'.trim($url, '/');
|
||||
if (!empty($view)) {
|
||||
$this->views[] = $view;
|
||||
}
|
||||
}
|
||||
|
||||
function submit(){
|
||||
$urlGetParam = isset($_GET['url']) ? '/' . $_GET['url'] : '/';
|
||||
foreach ($this->urls as $urlKey => $urlValue) {
|
||||
if ($urlValue === $urlGetParam) {
|
||||
$useView = $this->views[$urlKey];
|
||||
new $useView();
|
||||
die();
|
||||
}
|
||||
}
|
||||
echo 'Not Fount 404';
|
||||
die();
|
||||
//TODO: 404 přidělat
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user