Example a view with show fields:
I want retrive array result like this:
[
[title,
date_start
data_end
...
]
]
Use $view->result
to get the filtered rows, $view-field
for the fields, on which you can use the methods getValue()
for the field value and render()
for the formatted field as render array.
An example:
use Drupal\views\Views;
$values = [];
$view = views::getview('view_example');
if ($view) {
$view->execute();
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);
}
}
}
$field->advancedRender()
works though
Commented
Nov 29, 2018 at 23:57
You can use the field "global text" and add all fields inside of this field for show all fields that you have in one field
I hope can help you
Does this work?
[[title],...]
The available patterns should be visible below.