public function rewrite_routes()
    {
        if (!userHasPermission('admin:admin:utilities:rewriteRoutes')) {
            unauthorised();
        }

        // --------------------------------------------------------------------------

        $oInput = Factory::service('Input');
        if ($oInput->post('go')) {
            $oRoutesService = Factory::service('Routes');
            if ($oRoutesService->update()) {
                $this->data['success'] = 'Routes rewritten successfully.';
            } else {
                $this->data['error'] = 'There was a problem writing the routes. ';
                $this->data['error'] .= $oRoutesService->lastError();
            }
        }

        // --------------------------------------------------------------------------

        //  Load views
        Helper::loadView('rewriteRoutes');
    }
public function rewrite_routes()
    {
        if (!userHasPermission('admin:admin:utilities:rewriteRoutes')) {
            unauthorised();
        }

        // --------------------------------------------------------------------------

        $oInput = Factory::service('Input');
        if ($oInput->post('go')) {
            $oRoutesService = Factory::service('Routes');
            if ($oRoutesService->update()) {
                $this->data['success'] = 'Routes rewritten successfully.';
            } else {
                $this->data['error'] = 'There was a problem writing the routes. ';
                $this->data['error'] .= $oRoutesService->lastError();
            }
        }

        // --------------------------------------------------------------------------

        //  Load views
        Helper::loadView('rewriteRoutes');
    }
public function rewrite_routes ( ) { if ( ! userHasPermission ( 'admin:admin:utilities:rewriteRoutes' ) ) { unauthorised ( ) ; } // -------------------------------------------------------------------------- $ oInput = Factory :: service ( 'Input' ) ; if ( $ oInput -> post ( 'go' ) ) { $ oRoutesService = Factory :: service ( 'Routes' ) ; if ( $ oRoutesService -> update ( ) ) { $ this -> data [ 'success' ] = 'Routes rewritten successfully.' ; } else { $ this -> data [ 'error' ] = 'There was a problem writing the routes. ' ; $ this -> data [ 'error' ] .= $ oRoutesService -> lastError ( ) ; } } // -------------------------------------------------------------------------- //  Load views Helper :: loadView ( 'rewriteRoutes' ) ; }
Rewrite the app's routes
@return void
Rewrite the app s routes