Exemplo n.º 1
0
 /**
  * Dispatch request as RPC (remote procedure call)
  */
 public function dispatchRPC()
 {
     if ($this->request->hasContainerView()) {
         $this->setCurrentViewName($this->request->getContainerViewName());
     }
     return $this->invokeRPC();
 }
Exemplo n.º 2
0
 /**
  * Parser Uri request
  * @param Request $request
  */
 public function parserRequestUri($request)
 {
     $url = $request->getPathUri();
     if ($url) {
         $urlArr = preg_split("/\\//si", $url);
         if (preg_match("/^[a-z_]*\$/si", $urlArr[1])) {
             // http://localhost/?/ModuleName/ViewName/
             $module_name = $urlArr[0];
             $view_name = $request->pathNameToViewName($urlArr, 1);
             $uriParams = $request->getUriParameters($urlArr, 1);
         } elseif (preg_match("/^[a-z_]*\$/si", $urlArr[0])) {
             // http://localhost/?/ViewName/
             $module_name = '';
             $view_name = $request->pathNameToViewName($urlArr, 0);
             $uriParams = $request->getUriParameters($urlArr, 0);
         } else {
             throw new Exception();
             /** @todo Change Exception class more specific. */
         }
     } else {
         $module_name = '';
         $view_name = '';
         $uriParams = [];
     }
     return array('module' => $module_name, 'shortView' => $view_name, 'uriParams' => $uriParams);
 }