Pasar al contenido principal
Inicio
Desarrollo de software personalizado
  • Consultoría
    • Todos los servicios de consultoría
    • Ruby on Rails
    • ReactJs
    • Drupal
    • Precios
  • Alojamiento en línea
    • Todas las aplicaciones administradas
    • Aplicación de email
    • Jenkins
    • SMT
    • Precios
  • Sobre nosotros
    • Nuestra pila de tecnología
    • Nuestro proceso
    • Nuestro equipo
    • Estudios de casos
    • Contacta con nosotros
Vote up!

11

Vote down!

Drupal 9.5: How to render a block from a controller

Engineering Blog
Issue 2025Q2

Based on this excellent stackoverflow answer.

$bid = ??? // Get the block id through config, SQL or some other means
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->
  getViewBuilder('block_content')->view($block);
return $render;

.

Related Articles
Vote up!

2

Vote down!
A first functional test in Drupal 9 (test a redirect in a controller)
Vote up!

-4

Vote down!
Drupal asks for keycloak secret. What is that, where do you get it?
Vote up!

13

Vote down!
[FIXED]: Error: Call to a member function transformDimensions() on null in core/modules/ image/image.module
Vote up!

-8

Vote down!
How to set a default publish_on field when creating a node in drupal 9
Vote up!

4

Vote down!
Handle configuration settings in custom Drupal modules and example of using the configuration API in Drupal
Vote up!

7

Vote down!
Default Drupal file attachment types

Please log in to post a comment:

Authenticate through Google

User account menu

  • Register
  • Iniciar sesión

Pages

  • Issues
  • Engineering Blog
  • Site Updates
  • Tags
  • All Articles
  • Careers
  • Contact us
  • English
  • Español
  • Português
  • Russian
  • LinkedIn linkedin logo
  • Youtube youtube logo

Social Login

Authenticate through Google
Copyright (c) 2025 Wasya Co
Términos y condiciones

  201 W 5th St 11th Floor, Austin, TX 78701