$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');
package mac | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"network-chesswork/utilities" | |
"os" | |
"os/signal" | |
"sync" |
🌞 Morning 74 commits ████████▏░░░░░░░░░░░░ 38.7% | |
🌆 Daytime 42 commits ████▌░░░░░░░░░░░░░░░░ 22.0% | |
🌃 Evening 11 commits █▏░░░░░░░░░░░░░░░░░░░ 5.8% | |
🌙 Night 64 commits ███████░░░░░░░░░░░░░░ 33.5% |
<?php | |
// How to create horizontal tabs programmatically in Drupal 8, requires Field Group module | |
$form = array(); | |
$form['my_field'] = array( | |
'#type' => 'horizontal_tabs', | |
'#tree' => TRUE, | |
'#prefix' => '<div id="unique-wrapper">', | |
'#suffix' => '</div>', | |
); | |
$items = array( |
<?php | |
namespace Drupal\mymodule\Plugin\Block; | |
use Drupal\Core\Block\BlockBase; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; | |
use Drupal\file\Entity\File; | |
use Drupal\file\FileUsage\FileUsageInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; |
<?php | |
/** | |
* @file | |
* Contains Drupal\mymodule\Plugin\Block\ImageRenderExampleBlockByURI. | |
*/ | |
namespace Drupal\mymodule\Plugin\Block; | |
use Drupal\Core\Block\BlockBase; |
// Enable Devel module and go to /devel/php | |
$nodes = \Drupal::entityQuery("node") | |
->condition('created', strtotime('-30 days'), '<=') | |
->execute(); | |
$storage_handler = \Drupal::entityTypeManager()->getStorage("node"); | |
// $entities = $storage_handler->loadMultiple(); // Delete ALL nodes. | |
$entities = $storage_handler->loadMultiple($nodes); | |
$storage_handler->delete($entities); |