class NestedTableDragTestForm in Drupal 9
Provides a form for testing nested draggable tables.
Hierarchy
- class \Drupal\Core\Form\FormBase implements ContainerInjectionInterface, FormInterface uses DependencySerializationTrait, LoggerChannelTrait, MessengerTrait, RedirectDestinationTrait, StringTranslationTrait
- class \Drupal\tabledrag_test\Form\TableDragTestForm
- class \Drupal\tabledrag_test\Form\NestedTableDragTestForm
- class \Drupal\tabledrag_test\Form\TableDragTestForm
Expanded class hierarchy of NestedTableDragTestForm
1 string reference to 'NestedTableDragTestForm'
- tabledrag_test.routing.yml in core/
modules/ system/ tests/ modules/ tabledrag_test/ tabledrag_test.routing.yml - core/modules/system/tests/modules/tabledrag_test/tabledrag_test.routing.yml
File
- core/
modules/ system/ tests/ modules/ tabledrag_test/ src/ Form/ NestedTableDragTestForm.php, line 10
Namespace
Drupal\tabledrag_test\FormView source
class NestedTableDragTestForm extends TableDragTestForm {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'nested_tabledrag_test_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$parent_row_ids = [
'parent_1',
'parent_2',
'parent_3',
];
$parent_rows = array_combine($parent_row_ids, $parent_row_ids);
$form['table'] = $this
->buildTestTable($parent_rows, 'tabledrag-test-parent-table', 'tabledrag-test-nested-parent', FALSE);
$form['table']['#caption'] = $this
->t('Parent table');
$form['table'][reset($parent_row_ids)]['title'] = $this
->buildTestTable() + [
'#caption' => $this
->t('Nested table'),
];
$form['actions'] = $this
->buildFormActions();
return $form;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
public | function | 2 | |
DependencySerializationTrait:: |
public | function | 2 | |
FormBase:: |
protected | property | The config factory. | 3 |
FormBase:: |
protected | property | The request stack. | 1 |
FormBase:: |
protected | property | The route match. | |
FormBase:: |
protected | function | Retrieves a configuration object. | |
FormBase:: |
protected | function | Gets the config factory for this form. | 3 |
FormBase:: |
private | function | Returns the service container. | |
FormBase:: |
protected | function | Gets the current user. | |
FormBase:: |
protected | function | Gets the request object. | |
FormBase:: |
protected | function | Gets the route match. | |
FormBase:: |
protected | function | Gets the logger for a specific channel. | |
FormBase:: |
protected | function | Returns a redirect response object for the specified route. | |
FormBase:: |
public | function | Resets the configuration factory. | |
FormBase:: |
public | function | Sets the config factory for this form. | |
FormBase:: |
public | function | Sets the request stack object to use. | |
FormBase:: |
public | function |
Form validation handler. Overrides FormInterface:: |
72 |
LoggerChannelTrait:: |
protected | property | The logger channel factory service. | |
LoggerChannelTrait:: |
protected | function | Gets the logger for a specific channel. | |
LoggerChannelTrait:: |
public | function | Injects the logger channel factory. | |
MessengerTrait:: |
protected | property | The messenger. | 27 |
MessengerTrait:: |
public | function | Gets the messenger. | 27 |
MessengerTrait:: |
public | function | Sets the messenger. | |
NestedTableDragTestForm:: |
public | function |
Form constructor. Overrides TableDragTestForm:: |
|
NestedTableDragTestForm:: |
public | function |
Returns a unique string identifying the form. Overrides TableDragTestForm:: |
|
RedirectDestinationTrait:: |
protected | property | The redirect destination service. | 1 |
RedirectDestinationTrait:: |
protected | function | Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url. | |
RedirectDestinationTrait:: |
protected | function | Returns the redirect destination service. | |
RedirectDestinationTrait:: |
public | function | Sets the redirect destination service. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
TableDragTestForm:: |
protected | property | The state service. | |
TableDragTestForm:: |
protected | function | Builds the test table form actions. | |
TableDragTestForm:: |
protected | function | Builds the draggable test table. | |
TableDragTestForm:: |
public static | function |
Instantiates a new instance of this class. Overrides FormBase:: |
|
TableDragTestForm:: |
public | function |
Form submission handler. Overrides FormInterface:: |
|
TableDragTestForm:: |
public | function | Constructs a TableDragTestForm object. |