Created
June 24, 2013 21:14
-
-
Save msonnabaum/5853662 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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