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,
        );
    }
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,
        );
    }
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 , ) ; }
Parser Uri request
@param Request $request
Parser Uri request