I created a view with a "Custom text" field and want to get this field programmatically in Drupal 8.
I have:
$view = Views::getView('my_view');
$view->execute();
foreach($view->result as $row){
$node = Node::load($row->nid);
// Get here the view custom field with label "An example view field".
}
The $row field doesn't have the fields, nor the $node.
I now have:
$customField = $view->field['nothing'];
customField is an instance of Drupal\views\Plugin\views\field\Custom.
dpm($customField->render($row));
This returns class Drupal\views\Render\ViewsRenderPipelineMarkup with protectecd string with the same markup: {{ title }} test
.
Thanks,