$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);
$block_manager = \Drupal::service('plugin.manager.block');
<?php | |
namespace Drupal\mymodule; | |
use Drupal\Core\File\Exception\FileNotExistsException; | |
use Drupal\Core\File\FileSystemInterface; | |
use Drupal\file\FileRepositoryInterface; | |
use Drupal\Core\Logger\LoggerChannelFactoryInterface; | |
use Drupal\Core\Logger\LoggerChannelInterface; |