I'm trying to find a solution to embed a drupal custom block using PHP. I found this snippet that works :
<?php $block = \Drupal\block\Entity\Block::load('your_block_id'); $render = \Drupal::entityTypeManager()->getViewBuilder('block')->view($block); print render($render); ?>
The problem is that this code directly render the block content, I don't have any contextual links for that block. My question is, how to render the whole block (including contextual links), exactly like if I added it in a region using the UI.