You are here

function views_ui_build_form_url in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views_ui/ \views_ui_build_form_url()

Create the menu path for one of our standard AJAX forms based upon known information about the form.

Return value

\Drupal\Core\Url The URL object pointing to the form URL.

2 calls to views_ui_build_form_url()
EntityField::buildOptionsForm in core/modules/views/src/Plugin/views/field/EntityField.php
Default options form that provides the label widget that all fields should have.
ViewsFormBase::getForm in core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
Creates a new instance of this form.


core/modules/views_ui/, line 278
Provides the Views' administrative interface.


function views_ui_build_form_url(FormStateInterface $form_state) {
  $ajax = !$form_state
    ->get('ajax') ? 'nojs' : 'ajax';
  $name = $form_state
  $form_key = $form_state
  $display_id = $form_state
  $form_key = str_replace('-', '_', $form_key);
  $route_name = "views_ui.form_{$form_key}";
  $route_parameters = [
    'js' => $ajax,
    'view' => $name,
    'display_id' => $display_id,
  $url = Url::fromRoute($route_name, $route_parameters);
  if ($type = $form_state
    ->get('type')) {
      ->setRouteParameter('type', $type);
  if ($id = $form_state
    ->get('id')) {
      ->setRouteParameter('id', $id);
  return $url;