Spaces:
Sleeping
Sleeping
Commit
·
21dd205
1
Parent(s):
28b272e
modify default controller if needed
Browse files- mvc/app/libs/Core.php +5 -5
mvc/app/libs/Core.php
CHANGED
@@ -21,12 +21,12 @@
|
|
21 |
|
22 |
// print_r($this->getURL());
|
23 |
$url = $this->getURL();
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
28 |
}
|
29 |
-
|
30 |
require_once('../app/controllers/' . $this->defaultController . '.php');
|
31 |
$this->defaultController = new $this->defaultController;
|
32 |
}
|
|
|
21 |
|
22 |
// print_r($this->getURL());
|
23 |
$url = $this->getURL();
|
24 |
+
if(isset($url[0])){
|
25 |
+
if (file_exists('../app/controllers/' . ucwords($url[0]) . '.php')) {
|
26 |
+
$this->defaultController = ucwords($url[0]);
|
27 |
+
unset($url[0]);
|
28 |
+
}
|
29 |
}
|
|
|
30 |
require_once('../app/controllers/' . $this->defaultController . '.php');
|
31 |
$this->defaultController = new $this->defaultController;
|
32 |
}
|