function AnnounceController::getAnnouncements

Same name in other branches
  1. 10 core/modules/announcements_feed/src/Controller/AnnounceController.php \Drupal\announcements_feed\Controller\AnnounceController::getAnnouncements()

Returns the list of Announcements.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request.

Return value

array A build array with announcements.

1 string reference to 'AnnounceController::getAnnouncements'
announcements_feed.routing.yml in core/modules/announcements_feed/announcements_feed.routing.yml
core/modules/announcements_feed/announcements_feed.routing.yml

File

core/modules/announcements_feed/src/Controller/AnnounceController.php, line 39

Class

AnnounceController
Controller for community announcements.

Namespace

Drupal\announcements_feed\Controller

Code

public function getAnnouncements(Request $request) : array {
    $build = $this->announceRenderer
        ->render();
    if ($request->query
        ->get('_wrapper_format') != 'drupal_dialog.off_canvas') {
        $build['#theme'] = 'announcements_feed_admin';
        $build['#attached'] = [];
    }
    return $build;
}

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