class ViewsTestDataElementForm

Same name and namespace in other branches
  1. 11.x core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataElementForm.php \Drupal\views_test_data\Form\ViewsTestDataElementForm

Simple form page callback to test the view element.

@internal

Hierarchy

Expanded class hierarchy of ViewsTestDataElementForm

1 string reference to 'ViewsTestDataElementForm'
views_test_data.routing.yml in core/modules/views/tests/modules/views_test_data/views_test_data.routing.yml
core/modules/views/tests/modules/views_test_data/views_test_data.routing.yml

File

core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataElementForm.php, line 13

Namespace

Drupal\views_test_data\Form
View source
class ViewsTestDataElementForm extends FormBase {
  
  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'views_test_data_element_form';
  }
  
  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $form['view'] = [
      '#type' => 'view',
      '#name' => 'test_view_embed',
      '#display_id' => 'default',
      '#arguments' => [
        25,
      ],
      '#embed' => FALSE,
    ];
    return $form;
  }
  
  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.