예제 #1
0
파일: Index.php 프로젝트: acp3/module-feeds
 /**
  * @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');
 }