I could setup a nice batch, everything is working well.
But when the batch is finished, I would like to display a beautiful table with the computed results.
I could do it with the drupal_set_message (see below) function, but it is not good enough. [if mandatory, I accept to be redirected to a new page... but how can I pass the result in this case?]
function my_batch_finished_callback($success, $results, $operations) {
if ($success) {
$header=[t("col1"),t("col2")];
drupal_set_message( theme('table', ['header' => $header, 'rows' => $results]));
}
else {
// An error occurred.
...
}
}
$results
array is not to big, maybe I could usevariable_set
with the id of the batch and redirect to a page like/mybatch/results/{batch_id}
and usevariable_get
to display the table