I have the following code to get the value that is stored in a field
$nid = 76;
$node_details = Drupal\node\Entity\Node::load($nid);
$id = $field->value;
dpm($id);
With this I can get the correct value let says:
- id_string
But my field have a Field Formatter named title_formatter
that will take the string id_string
and will show something like this:
String
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 value.