I have the following code to get the value that is stored in a field
$nid = 76;
$node = \Drupal::service('entity.manager')->getStorage('node')->load($nid);
foreach ($node->field_aaaa as $delta) {
dpm($delta->value);
}
With this I can get the correct value let says:
* id_string1
* id_string2
* id_string3
But my field havehas a Field Formatter named title_formatter
that will take the string id_string1
and will show something like this:
String 1
In the UI this works fine if I chose my Title Formatter (title_formatter) for the field I can see the 'String'
when I viewing my node.
But I don't know how to apply the Field Formatter programmatically to the field values.?