You are here

public function HeartbeatController::friendInteract in Heartbeat 8

1 string reference to 'HeartbeatController::friendInteract'
heartbeat.routing.yml in ./heartbeat.routing.yml
heartbeat.routing.yml

File

src/Controller/HeartbeatController.php, line 268

Class

HeartbeatController
Class HeartbeatController.

Namespace

Drupal\heartbeat\Controller

Code

public function friendInteract($uid) {
  $myConfig = \Drupal::service('config.factory')
    ->getEditable('heartbeat_friend_interact.settings');
  $myConfig
    ->set('uid', $uid)
    ->save();

  //    $block = BlockViewBuilder::lazyBuilder('friendinteractblock', 'full');
  $block = \Drupal::service('plugin.manager.block');
  $block = $block
    ->createInstance('friend_interact_block')
    ->build();
  $blockMarkup = \Drupal::service('renderer')
    ->render($block);
  return [
    '#type' => 'markup',
    '#markup' => $blockMarkup,
  ];
}