Frontend\Modules\Blog\Actions\ArticleCommentsRss::parse PHP Метод

parse() приватный Метод

Parse the data into the template
private parse ( )
    private function parse()
    {
        // get vars
        $title = vsprintf(FL::msg('CommentsOn'), array($this->record['title']));
        $link = SITE_URL . FrontendNavigation::getURLForBlock('Blog', 'ArticleCommentsRss') . '/' . $this->record['url'];
        $detailLink = SITE_URL . FrontendNavigation::getURLForBlock('Blog', 'Detail');
        $description = null;
        // create new rss instance
        $rss = new FrontendRSS($title, $link, $description);
        // loop articles
        foreach ($this->items as $item) {
            // init vars
            $title = $item['author'] . ' ' . FL::lbl('On') . ' ' . $this->record['title'];
            $link = $detailLink . '/' . $this->record['url'] . '/#comment-' . $item['id'];
            $description = $item['text'];
            // create new instance
            $rssItem = new FrontendRSSItem($title, $link, $description);
            // set item properties
            $rssItem->setPublicationDate($item['created_on']);
            $rssItem->setAuthor($item['author']);
            // add item
            $rss->addItem($rssItem);
        }
        $rss->parse();
    }
ArticleCommentsRss