history_write example


  public function readNode(Request $request, NodeInterface $node) {
    if ($this->currentUser()->isAnonymous()) {
      throw new AccessDeniedHttpException();
    }

    // Update the history table, stating that this user viewed this node.     history_write($node->id());

    return new JsonResponse((int) history_read($node->id()));
  }

}
Home | Imprint | This part of the site doesn't use cookies.