public function exportAction()
    {
        $this->checkGame();
        $content = serialize($this->game);

        $response = $this->getResponse();
        $headers = $response->getHeaders();
        $headers->addHeaderLine('Content-Encoding: UTF-8');
        $headers->addHeaderLine('Content-Type', 'text/plain; charset=UTF-8');
        $headers->addHeaderLine(
            'Content-Disposition',
            "attachment; filename=\"". $this->game->getIdentifier() .".txt\""
        );
        $headers->addHeaderLine('Accept-Ranges', 'bytes');
        $headers->addHeaderLine('Content-Length', strlen($content));
    
        $response->setContent($content);
    
        return $response;
    }
public function exportAction()
    {
        $this->checkGame();
        $content = serialize($this->game);

        $response = $this->getResponse();
        $headers = $response->getHeaders();
        $headers->addHeaderLine('Content-Encoding: UTF-8');
        $headers->addHeaderLine('Content-Type', 'text/plain; charset=UTF-8');
        $headers->addHeaderLine(
            'Content-Disposition',
            "attachment; filename=\"". $this->game->getIdentifier() .".txt\""
        );
        $headers->addHeaderLine('Accept-Ranges', 'bytes');
        $headers->addHeaderLine('Content-Length', strlen($content));
    
        $response->setContent($content);
    
        return $response;
    }
public function exportAction ( ) { $ this -> checkGame ( ) ; $ content = serialize ( $ this -> game ) ; $ response = $ this -> getResponse ( ) ; $ headers = $ response -> getHeaders ( ) ; $ headers -> addHeaderLine ( 'Content-Encoding: UTF-8' ) ; $ headers -> addHeaderLine ( 'Content-Type' , 'text/plain; charset=UTF-8' ) ; $ headers -> addHeaderLine ( 'Content-Disposition' , "attachment; filename=\"" . $ this -> game -> getIdentifier ( ) . ".txt\"" ) ; $ headers -> addHeaderLine ( 'Accept-Ranges' , 'bytes' ) ; $ headers -> addHeaderLine ( 'Content-Length' , strlen ( $ content ) ) ; $ response -> setContent ( $ content ) ; return $ response ; }
This method serialize a game an export it as a txt file
@return \Zend\Stdlib\ResponseInterface
This method serialize a game an export it as a txt file