|
@@ -2,7 +2,7 @@
|
|
|
require_once('base.class.php');
|
|
|
require_once('router.class.php');
|
|
|
require_once('response.class.php');
|
|
|
- require_once('events.class.php');
|
|
|
+ require_once('events.interface.php');
|
|
|
class App extends Base implements Events {
|
|
|
private static $apps = array();
|
|
|
private $routers;
|
|
@@ -64,10 +64,18 @@
|
|
|
|
|
|
}
|
|
|
public function get_router($type, $path){
|
|
|
-
|
|
|
+ $ret = false;
|
|
|
+ if(isset($this->routers[$type])){
|
|
|
+ foreach($this->routers[$type] as $k => $router){
|
|
|
+ if($router->base == $path){
|
|
|
+ $ret = $router;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $ret;
|
|
|
}
|
|
|
public function create_router($type, $path){
|
|
|
- $router = new Router();
|
|
|
+ $router = new Router($path);
|
|
|
if(!isset($this->routers[$type])){
|
|
|
$this->routers[$type] = array();
|
|
|
}
|