Skip to content

Instantly share code, notes, and snippets.

@EclipseGc
Created September 27, 2012 18:03
Show Gist options
  • Save EclipseGc/3795450 to your computer and use it in GitHub Desktop.
Save EclipseGc/3795450 to your computer and use it in GitHub Desktop.
<?php
namespace Drupal\layout\Plugin\block\block;
use Drupal\block\BlockBase;
use Drupal\Core\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
/**
* @Plugin(
* id = "layout_block",
* subject = @Translation("Layout block"),
* module = "layout",
* settings = {
* "status" = TRUE,
* "cache" = DRUPAL_NO_CACHE
* }
* )
*/
class LayoutBlock extends BlockBase {
/**
* Implements BlockInterface::build().
*/
public function build() {
$layout = layout_manager()->createInstance('default_layout:layout__twocol', $this->configuration['layout']);
return array(
'#children' => $layout->renderLayout()
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment