Пример #1
0
 /**
  * @param string $feed
  *
  * @return \Symfony\Component\HttpFoundation\Response
  * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException
  */
 public function execute($feed)
 {
     if ($this->acl->hasPermission('frontend/' . $feed) === true) {
         $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']);
         try {
             $feedItems = $this->availableFeedsRegistrar->getFeedItemsByModuleName($feed)->fetchFeedItems();
             $this->feedGenerator->setTitle($this->config->getSettings(Schema::MODULE_NAME)['site_title'])->setDescription($this->translator->t($feed, $feed))->assign($feedItems);
             $this->setContentType('text/xml');
             return $this->response->setContent($this->feedGenerator->generateFeed());
         } catch (\InvalidArgumentException $e) {
         }
     }
     throw new Core\Controller\Exception\ResultNotExistsException();
 }
Пример #2
0
 public function renderFeedLinks()
 {
     $this->view->assign('available_feeds', $this->availableFeedsRegistrar->getAvailableModuleNames());
     $this->view->displayTemplate('Feeds/Partials/head.feed_links.tpl');
 }