Skip to content

Instantly share code, notes, and snippets.

@msonnabaum
Created June 24, 2013 21:14
Show Gist options
  • Save msonnabaum/5853662 to your computer and use it in GitHub Desktop.
Save msonnabaum/5853662 to your computer and use it in GitHub Desktop.
<?php
namespace Drupal\block\Controller;
use Symfony\Component\HttpFoundation\Response;
class AddressableBlock {
public function respond($block_id, $route) {
$build = array();
$entity = block_load($block_id);
$build[$block_id] = $entity->getPlugin()->build();
$build[$block_id]['#block'] = $entity;
return new Response(drupal_render($build));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment