class BatchTestMockForm
Same name and namespace in other branches
- 11.x core/modules/system/tests/modules/batch_test/src/Form/BatchTestMockForm.php \Drupal\batch_test\Form\BatchTestMockForm
Generate form of id batch_test_mock_form.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase extends \Drupal\Core\Form\FormInterface, \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Logger\LoggerChannelTrait, \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\batch_test\Form\BatchTestMockForm implements \Drupal\Core\Form\FormBase
Expanded class hierarchy of BatchTestMockForm
File
-
core/
modules/ system/ tests/ modules/ batch_test/ src/ Form/ BatchTestMockForm.php, line 13
Namespace
Drupal\batch_test\FormView source
class BatchTestMockForm extends FormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'batch_test_mock_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$form['test_value'] = [
'#title' => t('Test value'),
'#type' => 'textfield',
];
$form['submit'] = [
'#type' => 'submit',
'#value' => t('Submit'),
];
return $form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
batch_test_stack('mock form submitted with value = ' . $form_state->getValue('test_value'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.