Overview

Namespaces

  • Inteve
    • FeedGenerator
      • Feeds
        • GoogleMerchant
        • Heureka
        • PostFeed
        • Zbozi
      • Outputs
      • Responses
      • Utils

Classes

  • Inteve\FeedGenerator\Feed
  • Inteve\FeedGenerator\Feeds\GoogleMerchant\GoogleMerchantFeed
  • Inteve\FeedGenerator\Feeds\GoogleMerchant\GoogleMerchantItem
  • Inteve\FeedGenerator\Feeds\Heureka\HeurekaFeed
  • Inteve\FeedGenerator\Feeds\Heureka\HeurekaItem
  • Inteve\FeedGenerator\Feeds\Heureka\HeurekaItemParameter
  • Inteve\FeedGenerator\Feeds\PostFeed\PostFeed
  • Inteve\FeedGenerator\Feeds\PostFeed\PostFeedItem
  • Inteve\FeedGenerator\Feeds\Zbozi\ZboziFeed
  • Inteve\FeedGenerator\Feeds\Zbozi\ZboziItem
  • Inteve\FeedGenerator\Feeds\Zbozi\ZboziItemParameter
  • Inteve\FeedGenerator\Outputs\DirectOutput
  • Inteve\FeedGenerator\Outputs\FileOutput
  • Inteve\FeedGenerator\Outputs\MemoryOutput
  • Inteve\FeedGenerator\Responses\NetteDownloadResponse
  • Inteve\FeedGenerator\Utils\Helpers

Interfaces

  • Inteve\FeedGenerator\IFeed
  • Inteve\FeedGenerator\IFeedItem
  • Inteve\FeedGenerator\IOutput

Exceptions

  • Inteve\FeedGenerator\AssertException
  • Inteve\FeedGenerator\FeedGeneratorException
  • Inteve\FeedGenerator\FileSystemException
  • Inteve\FeedGenerator\InvalidArgumentException
  • Inteve\FeedGenerator\InvalidItemException
  • Inteve\FeedGenerator\OutputException
  • Inteve\FeedGenerator\StaticClassException
  • Overview
  • Namespace
  • Class
 1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 
<?php

    namespace Inteve\FeedGenerator\Responses;

    use Inteve\FeedGenerator\IFeed;
    use Inteve\FeedGenerator\Outputs;
    use Nette;


    class NetteDownloadResponse implements Nette\Application\IResponse
    {
        /** @var IFeed */
        private $feed;

        /** @var string */
        private $filename;

        /** @var bool */
        private $forceDownload;


        /**
         * @param  IFeed
         * @param  string
         * @param  bool
         */
        public function __construct(IFeed $feed, $filename, $forceDownload = TRUE)
        {
            $this->feed = $feed;
            $this->filename = $filename;
            $this->forceDownload = $forceDownload;
        }


        /**
         * Sends response to output.
         * @return void
         */
        public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse)
        {
            $httpResponse->setContentType($this->feed->getContentType());
            $httpResponse->setHeader('Content-Disposition',
                ($this->forceDownload ? 'attachment' : 'inline')
                    . '; filename="' . $this->filename . '"'
                    . '; filename*=utf-8\'\'' . rawurlencode($this->filename));

            $this->feed->generate(new Outputs\DirectOutput);
        }
    }
inteve/feed-generator master API documentation API documentation generated by ApiGen