Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 603 Bytes

cheatsheet_rex_article.md

File metadata and controls

28 lines (22 loc) · 603 Bytes

Artikel Cheatsheet

Klassenmethoden

$articles         = rex_article::getRootArticles();
$article          = rex_article::get($article_id);
$article          = rex_article::getCurrent();

Objektmethoden

$category         = $article->getCategory();
$categoryId       = $article->getCategoryId()

Beispiele

// Artikelnamen ausgeben
echo rex_article::getCurrent()->getName()

// Artikel nach Erstellungsdatum sortieren
$articles = rex_article::getRootArticles();
usort($articles, function ($a, $b) {
    return $a->getCreateDate() > $b->getCreateDate();
});