You are here

public function HeartbeatController::subCommentRequest in Heartbeat 8

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

File

src/Controller/HeartbeatController.php, line 251

Class

HeartbeatController
Class HeartbeatController.

Namespace

Drupal\heartbeat\Controller

Code

public function subCommentRequest($cid) {
  $subCommentConfig = \Drupal::configFactory()
    ->getEditable('heartbeat_comment.settings');
  $subCommentConfig
    ->set('cid', $cid)
    ->save();
  $response = new AjaxResponse();
  $response
    ->addCommand(new AppendCommand('#heartbeat-comment-' . $cid, BlockViewBuilder::lazyBuilder('heartbeatsubcommentblock', 'teaser')));
  $response
    ->addCommand(new SubCommentCommand($cid));
  return $response;
}