ViewsTestDataElementForm.php

Same filename and directory in other branches
  1. 9 core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataElementForm.php
  2. 8.9.x core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataElementForm.php
  3. 10 core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataElementForm.php

Namespace

Drupal\views_test_data\Form

File

core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataElementForm.php

View source
<?php

namespace Drupal\views_test_data\Form;

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Simple form page callback to test the view element.
 *
 * @internal
 */
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) {
    }

}

Classes

Title Deprecated Summary
ViewsTestDataElementForm Simple form page callback to test the view element.

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