$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');
| <?php | |
| /** | |
| * Method to generate random date between two dates | |
| * @param $sStartDate | |
| * @param $sEndDate | |
| * @param string $sFormat | |
| * @return bool|string | |
| */ | |
| function randomDate($sStartDate, $sEndDate, $sFormat = 'Y-m-d H:i:s') | |
| { |
| // String utils | |
| // | |
| // resources: | |
| // -- mout, https://github.com/mout/mout/tree/master/src/string | |
| /** | |
| * "Safer" String.toLowerCase() | |
| */ | |
| function lowerCase(str) { | |
| return str.toLowerCase(); |