public function __construct($layout, $seringue) { $this->layout = $this->set_layout($layout); $this->request = Kernel\Request::get_instance(); $this->response = Kernel\Response::get_instance(); $this->flash = Utilities\Flash::get_instance(); $this->route = Kernel\Route::get_instance(); $this->security = Kernel\Security::get_instance(); $this->seringue = $seringue; }
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(); }
public function __construct() { // Required because some times Doctrine and more generally spl_autoload_register() // doesn't work when used with an opcode cache (APC) register_shutdown_function("session_write_close"); session_start(); $this->container = Seringue::get_instance(); $this->container->page = new Utilities\Page($GLOBALS['env']['environment'] == "production" ? false : true); $this->route = Route::get_instance(); $this->request = Request::get_instance(); $this->response = Response::get_instance(); $this->log = $this->container->log_nano; $this->i18n = Utilities\I18N::get_instance(); $this->set_view_engine($this->container->configuration['view']['engine']); $this->cache = new Cache\Cache(new Cache\File(DIR_CACHE)); $this->get_cache_config(); $this->security = Security::get_instance(); }
static function url($url, $module = null) { return \NanoFramework\Kernel\Route::get_instance()->url($url, $module); }
private function init_route() { $route = array('front' => array('routes' => array('test' => array('route' => '/:categorie/:page/test.html', 'controller' => 'Accueil', 'action' => 'test'), 'default' => array('route' => '/:controller/:action'), 'default_small' => array('route' => '/:controller')), 'default_controller' => 'Accueil', 'default_action' => 'index', 'not_found' => 'Accueil/notfound')); Kernel\Route::get_instance()->set_route_config($route); }