Skip to content

Instantly share code, notes, and snippets.

View slivorezka's full-sized avatar

Andriy Malyeyev slivorezka

View GitHub Profile
@slivorezka
slivorezka / ImageRenderExampleBlockByURI.php
Created February 22, 2017 10:01 — forked from jerbob92/ImageRenderExampleBlockByURI.php
Render image into a block Drupal 8 Example by URI
<?php
/**
* @file
* Contains Drupal\mymodule\Plugin\Block\ImageRenderExampleBlockByURI.
*/
namespace Drupal\mymodule\Plugin\Block;
use Drupal\Core\Block\BlockBase;
@slivorezka
slivorezka / AddAnotherItem.php
Created September 21, 2018 07:32 — forked from leymannx/AddAnotherItem.php
Drupal 8 Ajax Form Add Item Example
<?php
/**
* @file
* Contains \Drupal\hello_world\Form\AddAnotherItem.
*/
namespace Drupal\hello_world\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
@slivorezka
slivorezka / TestAjaxFormSelect.php
Created September 21, 2018 07:32 — forked from jez500/TestAjaxFormSelect.php
Drupal 8 Ajax form example when select box changed
<?php
namespace Drupal\my_module\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Class TestAjaxFormSelect.
*/
$values = FieldConfig::loadByName('node', 'BUNDLE', 'FIELD')->getSetting('allowed_values');