Example #1
0
 function run()
 {
     ob_start();
     $request = $this->createRequest();
     $this->request = $request;
     $router = new MRouter($request);
     $action = $router->createAction();
     $this->controller = $action->controller;
     $action->run();
     ob_end_flush();
 }
Example #2
0
 public static function getRouter($name = null, array $options = array())
 {
     if (!isset($name)) {
         $app = MFactory::getApplication();
         $name = $app->getName();
     }
     $config = MFactory::getConfig();
     $options['mode'] = $config->get('sef');
     mimport('framework.application.router');
     $router = MRouter::getInstance($name, $options);
     if ($router instanceof Exception) {
         return null;
     }
     return $router;
 }