You are here

public function WorkbenchContentController::allContent in Workbench 8

Page callback for the workbench content page.

Note that we add Views information to the array and render the Views as part of the alter hook provided here.

Return value

array A Render API array of content creation options.

See also

hook_workbench_content_alter()

1 string reference to 'WorkbenchContentController::allContent'
workbench.routing.yml in ./workbench.routing.yml
workbench.routing.yml

File

src/Controller/WorkbenchContentController.php, line 112

Class

WorkbenchContentController
Generates the pages defined by Workbench.

Namespace

Drupal\workbench\Controller

Code

public function allContent() {
  $blocks = [];
  $settings = $this
    ->getSettings();
  $blocks['workbench_recent_content'] = [
    '#view_id' => $settings['all_main']['view_id'],
    '#view_display' => $settings['all_main']['display_id'],
    '#attributes' => [
      'class' => [
        'workbench-full',
      ],
    ],
  ];

  // Allow other modules to alter the default page.
  $context = 'all';
  \Drupal::moduleHandler()
    ->alter('workbench_content', $blocks, $context);
  return $this
    ->renderBlocks($blocks);
}