Skip to main content
Category:

Code snippet that can be used to access to field value for an node in drupal 8.

Example:

$node = \Drupal::entityTypeManager()->getStorage('node')->load($nid);
$body = $node->get('body')->getValue();
$title = $node->get('title')->getString();
$title = $node->get('title')->value;

Riadh Rahmi

Senior Web Developer PHP/Drupal & Laravel

I am a senior web developer, I have experience in planning and developing large scale dynamic web solutions especially in Drupal & Laravel.

Web Posts

Search

Page Facebook