Example #1
0
 /**
  * Initialise le Router en déterminant le couple Controller / Action
  * Mets à jour la Request
  * @exception RouteNotFoundException si l'uri n'est pas présente dans
  *          > la table de routage
  */
 public function init()
 {
     $url = array();
     if (Minz_Configuration::useUrlRewriting()) {
         try {
             $url = $this->buildWithRewriting();
         } catch (Minz_RouteNotFoundException $e) {
             throw $e;
         }
     } else {
         $url = $this->buildWithoutRewriting();
     }
     $url['params'] = array_merge($url['params'], Minz_Request::fetchPOST());
     Minz_Request::forward($url);
 }
Example #2
0
 /**
  * Constructeur
  * Initialise le dispatcher, met à jour la Request
  */
 public function __construct()
 {
     try {
         Minz_Configuration::register('system', DATA_PATH . '/config.php', DATA_PATH . '/config.default.php');
         $this->setReporting();
         Minz_Request::init();
         $url = $this->buildUrl();
         $url['params'] = array_merge($url['params'], Minz_Request::fetchPOST());
         Minz_Request::forward($url);
     } catch (Minz_Exception $e) {
         Minz_Log::error($e->getMessage());
         $this->killApp($e->getMessage());
     }
     $this->dispatcher = Minz_Dispatcher::getInstance();
 }