Modifying $view in hook_views_pre_render() I'm using Drupal 8.0.5, and need to force a title on a View.

I've tried various Views hooks, but will focus on hook_views_pre_render().

There's a ViewExecutable $view taken as an argument, which is not passed by reference.

I've tried:

function mymodule_views_pre_render(ViewExecutable $view) {
  $view-&gt;setTitle('foo');
  // $view-&gt;save(); // I've also tried this
}


I've gone through step-debugging to ensure it's getting called, but it seems the setTitle method does not affect the output that renders. I've also set my theme back to Seven to ensure there's not a theme issue involved.

I'm also happy to embed the View using a custom block, but I am running into the same issue there.

How does one modify a ViewExecutable object properly?
function hook_views_post_render(\Drupal\views\ViewExecutable $view) {
   if ($view-&gt;id() == 'viewid') {
    // Set the view title.
    $view-&gt;setTitle('NEW TITLE');
   }
}