Skip to content

Instantly share code, notes, and snippets.

@gwagroves
Last active October 3, 2016 15:49
Show Gist options
  • Save gwagroves/978362341baf65114bf17cd9c3efa6b2 to your computer and use it in GitHub Desktop.
Save gwagroves/978362341baf65114bf17cd9c3efa6b2 to your computer and use it in GitHub Desktop.
Drupal 8 hook arguments
$content[field_machine_name] =>
  0,
  1,
  2,
  #theme,
  #title,
  #label_display,
  #view_mode,
  #language,
  #field_name,
  #field_type,
  #field_translatable,
  #entity_type,
  #bundle,
  #object,
  #items Drupal\Core\Field\EntityReferenceFieldItemList,
  #formatter,
  #is_multiple,
  #cache,
  #weight
0 => 
  #theme,
  #node,
  #view_mode,
  #cache,
  #weight,
  #pre_render

array $variables

Key Type
elements array
theme_hook_original string
attributes array
title_attributes array
content_attributes array
title_prefix array
title_suffix array
db_is_active boolean
is_admin boolean
logged_in boolean
user Drupal\Core\Session\AccountProxy
directory string
view_mode string
teaser boolean
node Drupal\node\Entity\Node
date Drupal\Core\Render\Markup
author_name Drupal\Core\Render\Markup
url string
label array
page boolean
content array
author_attributes Drupal\Core\Template\Attribute
display_submitted boolean
#cache array

array $variables

Key Type
elements array
theme_hook_original string
attributes array
title_attributes array
content_attributes array
title_prefix array
title_suffix array
db_is_active boolean
is_admin boolean
logged_in boolean
user Drupal\Core\Session\AccountProxy
directory string
view_mode string
paragraph Drupal\paragraphs\Entity\Paragraph
content array
#cache array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment