protected function routeRequest()
    {
        //  What are we trying to access?
        $oUri        = Factory::service('Uri');
        $sModule     = $oUri->rsegment(3) ? $oUri->rsegment(3) : '';
        $sController = ucfirst($oUri->rsegment(4) ? $oUri->rsegment(4) : $sModule);
        $sMethod     = $oUri->rsegment(5) ? $oUri->rsegment(5) : 'index';

        if (empty($sModule)) {

            $oSession = Factory::service('Session', 'nails/module-auth');
            $oSession->keepFlashData();
            redirect('admin/admin/dashboard');

        } elseif (isset($this->adminControllers[$sModule]->controllers[$sController])) {

            $aRequestController           = $this->adminControllers[$sModule]->controllers[$sController];
            $this->data['currentRequest'] = $aRequestController;
            $sControllerName              = $aRequestController['className'];

            if (is_callable([$sControllerName, $sMethod])) {
                $oController = new $sControllerName();
                $oController->$sMethod();
            } else {
                show404();
            }

        } else {
            show404();
        }
    }
protected function routeRequest()
    {
        //  What are we trying to access?
        $oUri        = Factory::service('Uri');
        $sModule     = $oUri->rsegment(3) ? $oUri->rsegment(3) : '';
        $sController = ucfirst($oUri->rsegment(4) ? $oUri->rsegment(4) : $sModule);
        $sMethod     = $oUri->rsegment(5) ? $oUri->rsegment(5) : 'index';

        if (empty($sModule)) {

            $oSession = Factory::service('Session', 'nails/module-auth');
            $oSession->keepFlashData();
            redirect('admin/admin/dashboard');

        } elseif (isset($this->adminControllers[$sModule]->controllers[$sController])) {

            $aRequestController           = $this->adminControllers[$sModule]->controllers[$sController];
            $this->data['currentRequest'] = $aRequestController;
            $sControllerName              = $aRequestController['className'];

            if (is_callable([$sControllerName, $sMethod])) {
                $oController = new $sControllerName();
                $oController->$sMethod();
            } else {
                show404();
            }

        } else {
            show404();
        }
    }
protected function routeRequest ( ) { //  What are we trying to access? $ oUri = Factory :: service ( 'Uri' ) ; $ sModule = $ oUri -> rsegment ( 3 ) ? $ oUri -> rsegment ( 3 ) : '' ; $ sController = ucfirst ( $ oUri -> rsegment ( 4 ) ? $ oUri -> rsegment ( 4 ) : $ sModule ) ; $ sMethod = $ oUri -> rsegment ( 5 ) ? $ oUri -> rsegment ( 5 ) : 'index' ; if ( empty ( $ sModule ) ) { $ oSession = Factory :: service ( 'Session' , 'nails/module-auth' ) ; $ oSession -> keepFlashData ( ) ; redirect ( 'admin/admin/dashboard' ) ; } elseif ( isset ( $ this -> adminControllers [ $ sModule ] -> controllers [ $ sController ] ) ) { $ aRequestController = $ this -> adminControllers [ $ sModule ] -> controllers [ $ sController ] ; $ this -> data [ 'currentRequest' ] = $ aRequestController ; $ sControllerName = $ aRequestController [ 'className' ] ; if ( is_callable ( [ $ sControllerName , $ sMethod ] ) ) { $ oController = new $ sControllerName ( ) ; $ oController -> $ sMethod ( ) ; } else { show404 ( ) ; } } else { show404 ( ) ; } }
Routes the request to the appropriate controller

@return void
Routes the request to the appropriate controller