Skip to content

Instantly share code, notes, and snippets.

@jacerider
Created January 12, 2017 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacerider/3069559ea2966c626906dc0d4e459625 to your computer and use it in GitHub Desktop.
Save jacerider/3069559ea2966c626906dc0d4e459625 to your computer and use it in GitHub Desktop.
Create a block plugin instance directly and pass it the configuration
$configuration = [];
$variables['block_output'] = \Drupal::service('plugin.manager.block')
  ->createInstance($plugin_id, $configuration)
  ->build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment