Example #1
0
 function start()
 {
     $this->uri = new Registry(Router::gi()->parse($_SERVER['REQUEST_URI']));
     $controller = app::gi($this->uri->controller . 'Controller');
     ob_start();
     $controller->__call('action' . $this->uri->action, array($this->uri->id));
     $content = ob_get_clean();
     if ($this->config->scripts and is_array($this->config->scripts)) {
         foreach ($this->config->scripts as $script) {
             $controller->addScript($script);
         }
     }
     if ($this->config->styles and is_array($this->config->styles)) {
         foreach ($this->config->styles as $style) {
             $controller->addStyleSheet($style);
         }
     }
     $controller->renderPage($content);
 }