Drupal 8 Useful Snippets

21 Apr 2015

Drupal 8 is (hopefully) fast approaching and Drop42 is getting into it. See below for some useful snippets we had to lookup / search the code base for :

//current users language code
global $language;
$current_users_language_code = $language->language

//current users account
$account = \Drupal::currentUser();
$current_users_account = $account->getAccount();

//site admin email address
$site_config = \Drupal::config('');
$site_mail = $site_config->get('mail');

Read more and comment.

Welcome to our Blog

10 Jan 2014
Don't worry we won't be discussing what we had for breakfast here. It will be relevant Drupal discussions and more importantly bug fixes and work arounds for that stubborn problem you can't find the fix for !
Read more and comment.