You are here

public static function ScheduledPublishListing::viewListing in Scheduled Publish 8.3

Gets the listing view if possible.

1 string reference to 'ScheduledPublishListing::viewListing'
scheduled_publish.routing.yml in ./scheduled_publish.routing.yml
scheduled_publish.routing.yml

File

src/Controller/ScheduledPublishListing.php, line 18

Class

ScheduledPublishListing
Class ScheduledPublishListing.

Namespace

Drupal\scheduled_publish\Controller

Code

public static function viewListing() {
  if (scheduled_publish_get_node_fields()) {
    $view = Views::getView('scheduled_publish');
    $view
      ->setDisplay('block_1');
    return $view
      ->buildRenderable();
  }
  return [
    '#type' => 'html_tag',
    '#tag' => 'p',
    '#value' => t('A scheduled publish field has to be added to a content type before this functionality can be used.'),
  ];
}