Untitled
unknown
plain_text
2 years ago
882 B
9
Indexable
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Implements the custom form.
*/
class CustomForm extends FormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'custom_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
for ($i = 1; $i <= 100; $i++) {
$form['text_area_field_' . $i] = [
'#type' => 'text_format',
'#title' => $this->t('Text Area Field @num', ['@num' => $i]),
'#format' => 'full_html',
'#default_value' => '',
];
}
$form['submit'] = [
'#type' => 'submit',
'#value' => $this->t('Submit'),
];
return $form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
// Process form submission here.
}
}Editor is loading...