$executable->
setExposedInput($exposed_input);
if (!
$executable->
setDisplay($display_id)) { return [ '#markup' =>
t('Invalid display id @display',
['@display' =>
$display_id]),
];
} $executable->
setArguments($args);
// Store the current view URL for later use:
if ($executable->
hasUrl() &&
$executable->display_handler->
getOption('path'
)) { $path =
$executable->
getUrl();
} // Make view links come back to preview.
// Also override the current path so we get the pager, and make sure the
// Request object gets all of the proper values from $_SERVER.
$request = Request::
createFromGlobals();
$request->attributes->
set(RouteObjectInterface::ROUTE_NAME, 'entity.view.preview_form'
);
$request->attributes->
set(RouteObjectInterface::ROUTE_OBJECT, \Drupal::
service('router.route_provider'
)->
getRouteByName('entity.view.preview_form'
));
$request->attributes->
set('view',
$this->storage
);