public function run()
    {
        $requestRoute = $this->getRequestRoute();
        // create controller object
        $controller = $this->module->createController($requestRoute['route']);
        // throw error if the requests request does not returns a valid controller object
        if (!isset($controller[0]) && !is_object($controller[0])) {
            throw new NotFoundHttpException(sprintf("Unable to create controller '%s' for module '%s'.", $requestRoute['route'], $this->module->id));
        }
        
        Yii::debug('LUYA module run module "'.$this->module->id.'" route ' . $requestRoute['route'], __METHOD__);
        
        $this->controller = $controller[0];
        $originalController = Yii::$app->controller;
        
        /**
         * Override the current application controller in order to ensure current() url handling which is used
         * for relativ urls/rules.
         *
         * @see https://github.com/luyadev/luya/issues/1730
         */
        $this->controller->on(Controller::EVENT_BEFORE_ACTION, function ($event) {
            Yii::$app->controller = $this->controller;
        });
        /**
         * Restore the original controller instance after rendering.
         *
         * @see https://github.com/luyadev/luya/issues/1768
         */
        $this->controller->on(Controller::EVENT_AFTER_ACTION, function ($event) use ($originalController) {
            Yii::$app->controller = $originalController;
        });
        
        // run the action on the provided controller object
        return $this->controller->runAction($controller[1], $requestRoute['args']);
    }
public function run()
    {
        $requestRoute = $this->getRequestRoute();
        // create controller object
        $controller = $this->module->createController($requestRoute['route']);
        // throw error if the requests request does not returns a valid controller object
        if (!isset($controller[0]) && !is_object($controller[0])) {
            throw new NotFoundHttpException(sprintf("Unable to create controller '%s' for module '%s'.", $requestRoute['route'], $this->module->id));
        }
        
        Yii::debug('LUYA module run module "'.$this->module->id.'" route ' . $requestRoute['route'], __METHOD__);
        
        $this->controller = $controller[0];
        $originalController = Yii::$app->controller;
        
        /**
         * Override the current application controller in order to ensure current() url handling which is used
         * for relativ urls/rules.
         *
         * @see https://github.com/luyadev/luya/issues/1730
         */
        $this->controller->on(Controller::EVENT_BEFORE_ACTION, function ($event) {
            Yii::$app->controller = $this->controller;
        });
        /**
         * Restore the original controller instance after rendering.
         *
         * @see https://github.com/luyadev/luya/issues/1768
         */
        $this->controller->on(Controller::EVENT_AFTER_ACTION, function ($event) use ($originalController) {
            Yii::$app->controller = $originalController;
        });
        
        // run the action on the provided controller object
        return $this->controller->runAction($controller[1], $requestRoute['args']);
    }
public function run ( ) { $ requestRoute = $ this -> getRequestRoute ( ) ; // create controller object $ controller = $ this -> module -> createController ( $ requestRoute [ 'route' ] ) ; // throw error if the requests request does not returns a valid controller object if ( ! isset ( $ controller [ 0 ] ) && ! is_object ( $ controller [ 0 ] ) ) { throw new NotFoundHttpException ( sprintf ( "Unable to create controller '%s' for module '%s'." , $ requestRoute [ 'route' ] , $ this -> module -> id ) ) ; } Yii :: debug ( 'LUYA module run module "' . $ this -> module -> id . '" route ' . $ requestRoute [ 'route' ] , __METHOD__ ) ; $ this -> controller = $ controller [ 0 ] ; $ originalController = Yii :: $ app -> controller ; /**
         * Override the current application controller in order to ensure current() url handling which is used
         * for relativ urls/rules.
         *
         * @see https://github.com/luyadev/luya/issues/1730
         */ $ this -> controller -> on ( Controller :: EVENT_BEFORE_ACTION , function ( $ event ) { Yii :: $ app -> controller = $ this -> controller ; } ) ; /**
         * Restore the original controller instance after rendering.
         *
         * @see https://github.com/luyadev/luya/issues/1768
         */ $ this -> controller -> on ( Controller :: EVENT_AFTER_ACTION , function ( $ event ) use ( $ originalController ) { Yii :: $ app -> controller = $ originalController ; } ) ; // run the action on the provided controller object return $ this -> controller -> runAction ( $ controller [ 1 ] , $ requestRoute [ 'args' ] ) ; }
Run the route based on the values.

@return string|\yii\web\Response The response of the action, can be either a string or an object from response.
@throws \yii\web\NotFoundHttpException
Run the route based on the values .