You are here

public function DashboardController::getBlocksContents in Opigno dashboard 3.x

Same name and namespace in other branches
  1. 8 src/Controller/DashboardController.php \Drupal\opigno_dashboard\Controller\DashboardController::getBlocksContents()

Returns blocks contents.

1 string reference to 'DashboardController::getBlocksContents'
opigno_dashboard.routing.yml in ./opigno_dashboard.routing.yml
opigno_dashboard.routing.yml

File

src/Controller/DashboardController.php, line 156

Class

DashboardController
Controller for all the actions of the Learning Path manager app.

Namespace

Drupal\opigno_dashboard\Controller

Code

public function getBlocksContents() {
  $data = $this->blockService
    ->getDashboardBlocksContents();
  return new JsonResponse([
    'blocks' => $data['blocks'],
    'drupalSettings' => $data['attachments']['drupalSettings'] ?? [],
  ]);
}