protected function getLargeResponse($action, $result, $params)
    {
        parent::afterAction($action, $result);
        $format = Yii::$app->response->format;
        /** @var stream\RendererStream $rendererClass */
        switch ($format) {
            case Response::FORMAT_CSV:
                $rendererClass = 'netis\\utils\\crud\\stream\\CsvRendererStream';
                break;
            case Response::FORMAT_JSON:
                $rendererClass = 'netis\\utils\\crud\\stream\\JsonRendererStream';
                break;
            case Response::FORMAT_XML:
                $rendererClass = 'netis\\utils\\crud\\stream\\XmlRendererStream';
                break;
            case Response::FORMAT_XLS:
                $rendererClass = 'netis\\utils\\crud\\stream\\XlsRendererStream';
                break;
            default:
                throw new \HttpInvalidParamException('Unsupported format requested: '.$format);
        }
        $streamName = $format.'View';
        if (!stream_wrapper_register($streamName, $rendererClass)) {
            throw new Exception('Failed to register the RenderStream wrapper.');
        }
        $rendererClass::$params = $params;
        $response = new \yii\web\Response();
        $response->setDownloadHeaders($action->id.'.'.$format, Yii::$app->response->acceptMimeType);
        $response->format = Response::FORMAT_RAW;
        $streamParams = [
            'format' => $format,
            'serializer' => $this->serializer,
        ];
        $response->stream = fopen("$streamName://{$action->id}?".\http_build_query($streamParams), "r");

        return $response;
    }
protected function getLargeResponse($action, $result, $params)
    {
        parent::afterAction($action, $result);
        $format = Yii::$app->response->format;
        /** @var stream\RendererStream $rendererClass */
        switch ($format) {
            case Response::FORMAT_CSV:
                $rendererClass = 'netis\\utils\\crud\\stream\\CsvRendererStream';
                break;
            case Response::FORMAT_JSON:
                $rendererClass = 'netis\\utils\\crud\\stream\\JsonRendererStream';
                break;
            case Response::FORMAT_XML:
                $rendererClass = 'netis\\utils\\crud\\stream\\XmlRendererStream';
                break;
            case Response::FORMAT_XLS:
                $rendererClass = 'netis\\utils\\crud\\stream\\XlsRendererStream';
                break;
            default:
                throw new \HttpInvalidParamException('Unsupported format requested: '.$format);
        }
        $streamName = $format.'View';
        if (!stream_wrapper_register($streamName, $rendererClass)) {
            throw new Exception('Failed to register the RenderStream wrapper.');
        }
        $rendererClass::$params = $params;
        $response = new \yii\web\Response();
        $response->setDownloadHeaders($action->id.'.'.$format, Yii::$app->response->acceptMimeType);
        $response->format = Response::FORMAT_RAW;
        $streamParams = [
            'format' => $format,
            'serializer' => $this->serializer,
        ];
        $response->stream = fopen("$streamName://{$action->id}?".\http_build_query($streamParams), "r");

        return $response;
    }
protected function getLargeResponse ( $ action , $ result , $ params ) { parent :: afterAction ( $ action , $ result ) ; $ format = Yii :: $ app -> response -> format ; /** @var stream\RendererStream $rendererClass */ switch ( $ format ) { case Response :: FORMAT_CSV : $ rendererClass = 'netis\\utils\\crud\\stream\\CsvRendererStream' ; break ; case Response :: FORMAT_JSON : $ rendererClass = 'netis\\utils\\crud\\stream\\JsonRendererStream' ; break ; case Response :: FORMAT_XML : $ rendererClass = 'netis\\utils\\crud\\stream\\XmlRendererStream' ; break ; case Response :: FORMAT_XLS : $ rendererClass = 'netis\\utils\\crud\\stream\\XlsRendererStream' ; break ; default : throw new \ HttpInvalidParamException ( 'Unsupported format requested: ' . $ format ) ; } $ streamName = $ format . 'View' ; if ( ! stream_wrapper_register ( $ streamName , $ rendererClass ) ) { throw new Exception ( 'Failed to register the RenderStream wrapper.' ) ; } $ rendererClass :: $ params = $ params ; $ response = new \ yii \ web \ Response ( ) ; $ response -> setDownloadHeaders ( $ action -> id . '.' . $ format , Yii :: $ app -> response -> acceptMimeType ) ; $ response -> format = Response :: FORMAT_RAW ; $ streamParams = [ 'format' => $ format , 'serializer' => $ this -> serializer , ] ; $ response -> stream = fopen ( "$streamName://{$action->id}?" . \ http_build_query ( $ streamParams ) , "r" ) ; return $ response ; }
Returns an open renderer stream that outputs formatted items from the dataProvider.
@param Action $action the action just executed.
@param mixed $result  the action return result.
@param array $params params extracted from result
@return Response
@throws Exception when failed to register the renderer stream class
@throws \HttpInvalidParamException
Returns an open renderer stream that outputs formatted items from the dataProvider .