FormTestAlterForm.php in Drupal 9
Same filename and directory in other branches
Namespace
Drupal\form_test\FormFile
core/modules/system/tests/modules/form_test/src/Form/FormTestAlterForm.phpView source
<?php
namespace Drupal\form_test\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Form builder for testing hook_form_alter() and hook_form_FORM_ID_alter().
*
* @internal
*/
class FormTestAlterForm extends FormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'form_test_alter_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
// Elements can be added as needed for future testing needs, but for now,
// we're only testing alter hooks that do not require any elements added by
// this function.
return $form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
}
}
Classes
Name | Description |
---|---|
FormTestAlterForm | Form builder for testing hook_form_alter() and hook_form_FORM_ID_alter(). |