public function getReturnAction($defaultActionId = 'index')
    {
        if ($this->returnAction !== null) {
            return $this->returnAction;
        }

        $sessionKey = '__adminReturnAction';
        $actionId = Yii::$app->getSession()->get($sessionKey, $defaultActionId);
        $actionId = trim($actionId, '/');
        if ($actionId === 'index') {
            return $actionId;
        }
        if (strpos($actionId, '/') !== false) {
            $controllerId = StringHelper::dirname($actionId);
            if ($controllerId !== $this->controller->getUniqueId()) {
                return 'index';
            }
            $actionId = StringHelper::basename($actionId);
        }
        if (!$this->actionExists($actionId)) {
            return 'index';
        }
        return $actionId;
    }
public function getReturnAction($defaultActionId = 'index')
    {
        if ($this->returnAction !== null) {
            return $this->returnAction;
        }

        $sessionKey = '__adminReturnAction';
        $actionId = Yii::$app->getSession()->get($sessionKey, $defaultActionId);
        $actionId = trim($actionId, '/');
        if ($actionId === 'index') {
            return $actionId;
        }
        if (strpos($actionId, '/') !== false) {
            $controllerId = StringHelper::dirname($actionId);
            if ($controllerId !== $this->controller->getUniqueId()) {
                return 'index';
            }
            $actionId = StringHelper::basename($actionId);
        }
        if (!$this->actionExists($actionId)) {
            return 'index';
        }
        return $actionId;
    }
public function getReturnAction ( $ defaultActionId = 'index' ) { if ( $ this -> returnAction !== null ) { return $ this -> returnAction ; } $ sessionKey = '__adminReturnAction' ; $ actionId = Yii :: $ app -> getSession ( ) -> get ( $ sessionKey , $ defaultActionId ) ; $ actionId = trim ( $ actionId , '/' ) ; if ( $ actionId === 'index' ) { return $ actionId ; } if ( strpos ( $ actionId , '/' ) !== false ) { $ controllerId = StringHelper :: dirname ( $ actionId ) ; if ( $ controllerId !== $ this -> controller -> getUniqueId ( ) ) { return 'index' ; } $ actionId = StringHelper :: basename ( $ actionId ) ; } if ( ! $ this -> actionExists ( $ actionId ) ) { return 'index' ; } return $ actionId ; }
Returns the ID of action, which should be used for return redirect.
If action belongs to another controller or does not exist in current controller - 'index' is returned.
@param string $defaultActionId default action ID.
@return string action ID.
Returns the ID of action which should be used for return redirect . If action belongs to another controller or does not exist in current controller - index is returned .