Yes, I see there are many answers already posted here and elsewhere for this; but sadly they are all wrong. These answers include any of the following:
$view->style_plugin->getFieldValue($rid, 'field_myfield'); foreach ($view->result as $rid => $row) { foreach ($view->field as $fid => $field ) { $values[$rid][$fid . '-value'] = $field->getValue($row); $values[$rid][$fid . '-render'] = $field->render($row); } } $views->_entity->...
or a few others. These are all returning the field of the base entity returned by the view. These are entity field values. These are not the "fields of the view".
I know how to access these in a twig template (views-view-fields–[viewname]–[displayname].html.twig) but haven’t been able to find out how to do this in a custom module.
Answer:
From @4k4’s tip below:
This works:
foreach ($view->result as $rid => $row) { $type[$row->nid] = $view->field['my_views_field']->advancedRender($row)->__toString(); }