Frontend\Modules\Blog\Actions\CommentsRss::parse PHP Method

parse() private method

Parse the data into the template
private parse ( )
    private function parse()
    {
        // get vars
        $title = \SpoonFilter::ucfirst(FL::msg('BlogAllComments'));
        $link = SITE_URL . FrontendNavigation::getURLForBlock('Blog');
        $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') . ' ' . $item['post_title'];
            $link = $detailLink . '/' . $item['post_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();
    }