Returns the form to edit a view.
\Drupal\views_ui\ViewUI $view: The view being deleted.
string|null $display_id: (optional) The display ID being edited. Defaults to NULL, which will load the first available display.
array An array containing the Views edit and preview forms.
public function edit(ViewUI $view, $display_id = NULL) {
$name = $view
->label();
$data = $this->viewsData
->get($view
->get('base_table'));
if (isset($data['table']['base']['title'])) {
$name .= ' (' . $data['table']['base']['title'] . ')';
}
drupal_set_title($name);
$build['edit'] = entity_get_form($view, 'edit', array(
'display_id' => $display_id,
));
$build['preview'] = entity_get_form($view, 'preview', array(
'display_id' => $display_id,
));
return $build;
}