Вот мой код.
class router {
protected $router;
protected $dispatcher;
protected $ControllerObj;
private function Controller($name) {
if(@!$this->ControllerObj[$name]){
require '../App/Controllers/' . $name . '.php';
$this->ControllerObj[$name] = new $name();
}
return $this->ControllerObj[$name];
}
public function __construct() {
$this->router = new Hoa\Router\Http();
$this->dispatcher = new Hoa\Dispatcher\Basic();
}
public function get($id, $url, $f) {
$func = $this->Controller($f[0]);
//$func->$f[1]('78','87');
$this->router->get($id, $url, $func->$f[1]);
}
public function post($id, $url, $f) {
$func = $this->Controller($f[0]);
//$func->$f[1]('78','87');
$this->router->post($id, $url, $func->$f[1]);
}
public function Run() {
$this->dispatcher->dispatch($this->router);
}
}
Функцию роутр не обрабатывает и сыпятся ошибки
Notice: Undefined property: index::$TestUrl in /home/lucifer/php/Core/modules/router.php on line 29
Notice: Undefined property: index::$Test in /home/lucifer/php/Core/modules/router.php on line 29
Но если вызвать функцию вручную
$func->$f[1]('78','87');
(а не через роутер) то всё ok