Example #1
0
 public function execute($get, $post)
 {
     $uri = isset($get['_url']) && strlen(trim($get['_url'])) > 0 ? trim($get['_url']) : '';
     $params = null;
     if (count($get) > 1) {
         $params = array();
         foreach ($get as $param => $value) {
             if ($param != '_url') {
                 $params[$param] = $value;
             }
         }
     }
     if ($this->_di->get('session')->getData('auth_user_id')) {
         $this->_di->get('builder')->assign('auth', true);
     }
     $this->calcBasket();
     $this->_di->get('request')->setUri($uri);
     //$this->_di->get('request')->setQuery($params);
     //$this->_di->get('request')->setPost($post);
     $controller = 'app\\controller\\' . ControllerBase::getController($uri);
     if (class_exists($controller, true)) {
         return (new $controller($this->_di))->execute();
     } else {
         return (new ErrorController($this->_di))->error404Action();
     }
 }