Exemplo n.º 1
0
 private function _build_get_enviroment()
 {
     $data = self::_http_get_request();
     if (isset(APP::$allow_pretty_url) and APP::$allow_pretty_url == false) {
         // ELIMINA POSIBLE DUPLICIDAD DE ORIGENES.
         if (isset($data['request'])) {
             $this->go_to($data['request']);
         }
         // ESTABLCE ÚNICAMENTE LO CONTENIDO EN $r
         if (!empty($data['r'])) {
             $data['request'] = $data['r'];
             unset($data['r']);
         } else {
             $data['request'] = null;
         }
     } elseif (isset(APP::$allow_pretty_url) and APP::$allow_pretty_url == true) {
         if (isset($data['r'])) {
             $this->go_to($data['r']);
         }
     }
     $routing = Routes::rewrite($data);
     self::$context = Routes::$context;
     // CARGA CONTEXTO
     self::$language = Routes::$language;
     // CARGA LENGAUES
     if (!is_array($routing)) {
         return true;
     }
     foreach ($routing as $varname => $val) {
         $this->{$varname} = $val;
     }
     // REQUEST ASSIGNMENT
     $this->request = $routing['request'];
     self::$request_proccessed = $routing['request'];
     // FULL ARRAY CONFIG
     self::$request_full_array = array('context' => self::$context, 'lang' => isset(self::$language['prefix']) ? self::$language['prefix'] : null, 'controller' => $this->controller, 'action' => $this->action, 'getAttrs' => isset($routing['getAttrs']) ? $routing['getAttrs'] : array());
     return true;
 }