Exemple #1
0
 public function addItem(Rss $feed, Page $page)
 {
     $authors = (array) Helpers::getTags($page, 'Author');
     foreach ($authors as &$author) {
         $author = $author->getName();
     }
     $feed->item(['guid' => $page->url(), 'title' => $page->getTitle(), 'description|cdata' => $page->getDescription(), 'link' => $page->url(), 'pubDate' => $page->getVisibleFrom()->format('r'), 'author|cdata' => empty($authors) ? null : implode(',', $authors)]);
 }
Exemple #2
0
 public function addItem(Rss $feed, Page $page)
 {
     $tags = Helpers::getTags($page, 'Author');
     $authors = [];
     if (count($tags)) {
         foreach ($tags as $tag) {
             $authors[] = $tag->getName();
         }
     }
     $feed->item(['guid' => $page->url(), 'title' => $page->getTitle(), 'description|cdata' => $page->getDescription(), 'link' => $page->url(), 'pubDate' => $page->getVisibleFrom()->format('r'), 'author|cdata' => empty($authors) ? null : implode(',', $authors)]);
 }
Exemple #3
0
 /**
  * Parameters :
  * - title
  * - link
  * - description
  * - author
  * - category
  * - comments
  * - enclosure
  * - guid
  * - pubDate
  * - source
  *
  * @static 
  */
 public static function item($parameters)
 {
     return \Thujohn\Rss\Rss::item($parameters);
 }