$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');
| [ | |
| { | |
| "abbr": "AL", | |
| "name": "Alabama", | |
| "capital": "Montgomery", | |
| "lat": "32.361538", | |
| "long": "-86.279118" | |
| }, | |
| { | |
| "abbr": "AK", |
| --- | |
| # This has been tested with ansible 1.3 with these commands: | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
| # NB: The type of the variable is crucial! | |
| - name: Ansible Conditionals Examples | |
| hosts: $hosts | |
| vars_files: |
| " Don't try to be vi compatible | |
| set nocompatible | |
| " Helps force plugins to load correctly when it is turned back on below | |
| filetype off | |
| " TODO: Load plugins here (pathogen or vundle) | |
| " Turn on syntax highlighting | |
| syntax on |
| <?php | |
| /** | |
| * @Given /^I am viewing a product with the following related products:$/ | |
| */ | |
| public function assertRelatedProducts(TableNode $relatedProducts) { | |
| // First, create a product. | |
| $product = (object) array( | |
| 'title' => 'Parent Product', | |
| 'type' => 'product', | |
| 'uid' => 1, |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| <?php | |
| /** | |
| * @Given /^I am logged in as a user in the "(?P<group>[^"]*)" group$/ | |
| */ | |
| public function iAmLoggedInAsAUserInTheGroup($group) { | |
| // Create user. | |
| $account = (object) array( | |
| 'pass' => $this->getDrupal()->random->name(), | |
| 'name' => $this->getDrupal()->random->name(), | |
| ); |