ViewsTestDataElementForm.php in Drupal 8
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;
class ViewsTestDataElementForm extends FormBase {
public function getFormId() {
return 'views_test_data_element_form';
}
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;
}
public function submitForm(array &$form, FormStateInterface $form_state) {
}
}