public function afterAction($action, $result)
    {
        $params = [];
        if ($result instanceof \yii\web\Response || is_string($result)) {
            return parent::afterAction($action, $result);
        } elseif ($result instanceof Model) {
            $params['model'] = $result;
        } elseif ($result instanceof DataProviderInterface) {
            $params['dataProvider'] = $result;
        } else {
            $params = $result;
        }

        if (($response = $this->getHtmlResponse($action, $result, $params)) !== false) {
            return $response;
        }

        if (($response = $this->getPdfResponse($action, $result, $params)) !== false) {
            return $response;
        }

        if (($response = $this->getSerializedResponse($action, $result, $params)) !== false) {
            return $response;
        }

        // use a renderer stream for large data providers
        return $this->getLargeResponse($action, $result, $params);
    }
public function afterAction($action, $result)
    {
        $params = [];
        if ($result instanceof \yii\web\Response || is_string($result)) {
            return parent::afterAction($action, $result);
        } elseif ($result instanceof Model) {
            $params['model'] = $result;
        } elseif ($result instanceof DataProviderInterface) {
            $params['dataProvider'] = $result;
        } else {
            $params = $result;
        }

        if (($response = $this->getHtmlResponse($action, $result, $params)) !== false) {
            return $response;
        }

        if (($response = $this->getPdfResponse($action, $result, $params)) !== false) {
            return $response;
        }

        if (($response = $this->getSerializedResponse($action, $result, $params)) !== false) {
            return $response;
        }

        // use a renderer stream for large data providers
        return $this->getLargeResponse($action, $result, $params);
    }
public function afterAction ( $ action , $ result ) { $ params = [ ] ; if ( $ result instanceof \ yii \ web \ Response || is_string ( $ result ) ) { return parent :: afterAction ( $ action , $ result ) ; } elseif ( $ result instanceof Model ) { $ params [ 'model' ] = $ result ; } elseif ( $ result instanceof DataProviderInterface ) { $ params [ 'dataProvider' ] = $ result ; } else { $ params = $ result ; } if ( ( $ response = $ this -> getHtmlResponse ( $ action , $ result , $ params ) ) !== false ) { return $ response ; } if ( ( $ response = $ this -> getPdfResponse ( $ action , $ result , $ params ) ) !== false ) { return $ response ; } if ( ( $ response = $ this -> getSerializedResponse ( $ action , $ result , $ params ) ) !== false ) { return $ response ; } // use a renderer stream for large data providers return $ this -> getLargeResponse ( $ action , $ result , $ params ) ; }
If the response format is HTML, either performs a redirect or renders a view template.
If the result is or contains a data provider with pagination disabled or a large page size,
then a renderer stream is used.
In other cases, a serializer converts the response to an array.
No extra action is taken when the result is already a Response object.

@param Action $action the action just executed.
@param mixed $result  the action return result.
@return mixed the processed action result.
@throws Exception
@throws \HttpInvalidParamException
@throws \yii\base\InvalidConfigException
If the response format is HTML either performs a redirect or renders a view template . If the result is or contains a data provider with pagination disabled or a large page size then a renderer stream is used . In other cases a serializer converts the response to an array . No extra action is taken when the result is already a Response object .