function AggregatorController::pageLast

Same name and namespace in other branches
  1. 8.9.x core/modules/aggregator/src/Controller/AggregatorController.php \Drupal\aggregator\Controller\AggregatorController::pageLast()

Displays the most recent items gathered from any feed.

Return value

string The rendered list of items for the feed.

1 string reference to 'AggregatorController::pageLast'
aggregator.routing.yml in core/modules/aggregator/aggregator.routing.yml
core/modules/aggregator/aggregator.routing.yml

File

core/modules/aggregator/src/Controller/AggregatorController.php, line 175

Class

AggregatorController
Returns responses for aggregator module routes.

Namespace

Drupal\aggregator\Controller

Code

public function pageLast() {
    $items = $this->entityTypeManager()
        ->getStorage('aggregator_item')
        ->loadAll(20);
    $build = $this->buildPageList($items);
    $build['#attached']['feed'][] = [
        'aggregator/rss',
        $this->config('system.site')
            ->get('name') . ' ' . $this->t('aggregator'),
    ];
    $build['#cache']['tags'] = $this->entityTypeManager()
        ->getDefinition('aggregator_item')
        ->getListCacheTags();
    return $build;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.