public function testController() { $d = Kernel\Dispatcher::get_instance(); $d->set_controller("controller"); $d->set_action("action"); $this->assert->string($d->get_controller())->isEqualTo("controller"); $this->assert->string($d->get_action())->isEqualTo("action"); }
public function __construct($view, $seringue) { $this->view = $view; $this->seringue = $seringue; $this->page = $this->seringue->page; $this->log = $this->seringue->log_nano; $this->dispatcher = Dispatcher::get_instance(); $this->request = Request::get_instance(); $this->response = Response::get_instance(); $this->route = Route::get_instance(); $this->flash = Utilities\Flash::get_instance(); $this->security = Security::get_instance(); $this->_init(); }
static function module_partial($module, $controller, $action, $parameters = array()) { return \NanoFramework\Kernel\Dispatcher::get_instance()->partial($module, $controller, $action, $parameters); }
<?php /** * * @author Stéphane BRUN */ use NanoFramework\Kernel; $GLOBALS['env']['MODULE_NAME'] = 'Demo'; require_once '../configuration/configuration.php'; Kernel\Dispatcher::get_instance()->dispatch();