Skip to content

Instantly share code, notes, and snippets.

@chriscalip
chriscalip / cduxx_get_bulk_field_values.php
Created August 16, 2019 03:20
bulk data retrieval for drupal 8.
<?php
/**
* Utility get all field values
* @param string $entity_type Entity Type eg. (node,taxonomy)
* @param string $bundle Bundle (asset)
* @param string $field_name Field Name machine_name (field_asset_address)
* @param string $column_key $records keyed by column eg. (entity_id)
* @param array $columns Field columns eg. (value,uri,address_line1,locality)
@jez500
jez500 / TestAjaxFormSelect.php
Created January 8, 2018 00:53
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.
*/
@pfaocle
pfaocle / gen-d8-salt.sh
Created March 8, 2016 09:39
Generate Drupal 8 hash salt
drush eval "var_dump(Drupal\Component\Utility\Crypt::randomBytesBase64(55))"