$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);
$block_manager = \Drupal::service('plugin.manager.block');
<!DOCTYPE html> | |
<html<?php print $html_attributes; ?>> | |
<head> | |
<?php print $head; ?> | |
<title><?php print $head_title; ?></title> | |
<?php print $styles; ?> | |
<?php print $head_scripts; ?> | |
</head> | |
<body<?php print $body_attributes;?>> |
<?php | |
// Load the currently logged in user. | |
global $user; | |
// Check if the user has the 'editor' role. | |
if (in_array('editor', $user->roles)) { | |
// do fancy stuff | |
} | |
?> |
alias drush='~/drush/drush' | |
alias php='/usr/local/bin/php5-53STABLE-CLI' | |
export DRUSH_PHP=/usr/local/bin/php5-53STABLE-CLI |
<?php | |
/* Script located in the docroot for your Drupal 8 site */ | |
use Drupal\Core\DrupalKernel; | |
use Drupal\Core\Site\Settings; | |
use Symfony\Component\HttpFoundation\Request; | |
$autoloader = require_once __DIR__ . '/core/vendor/autoload.php'; | |
use GuzzleHttp\Client; |