How to get programatically 'display_options' for a specific page in Views I am a bit confused on how I should code this...
I have a view based on a custom content entity with 4 displays: default (hidden), Page (page_1), Export Entité (rest_export_1) and Export pour Maps (rest_export_2).   

   

Devel shows this for this view:
   

I'd like to get the value of the path for 'rest_export_1' to use it in $name.
My code:   

function association_exportCSV($view, $page)
{
  $view = \Drupal\views\Views::getView($view);
  $name = ???
  $page = $view-&gt;preview($page);
  file_unmanaged_save_data($page , 'private://' . $name . '.csv', FILE_EXISTS_REPLACE);

}


What should I do next? How to get $name from 'path'?
Try with:

function association_exportCSV($view, $page) {
  $view = \Drupal\views\Views::getView($view);
  // $display_id in this case is  'rest_export_1
  $view-&gt;setDisplay($page);
  $path = $view-&gt;getPath();
  file_unmanaged_save_data($page, 'private://' . $path . '.csv', FILE_EXISTS_REPLACE);
}