You are here

public function AggregatorController::pageLast in Drupal 8

Same name and namespace in other branches
  1. 9 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'),
  ];
  return $build;
}