Как создать контейнер в форме (я хочу туда зпихнуть обработку AJAX) и сделать его как wrapper ,чтобы отделить запрос от остальной формы .Как будет его лучше сделать ,чтобы он работал пытался сделать таким методом,но не сработало
<?php
$form['author']['#prefix'] = '<div class="first">';
$form['author']['#suffix'] = '</div>';
?>
<?php
public function buildForm(array $form, FormStateInterface $form_state) {
$form['example_select'] = [
'#type' => 'select',
'#title' => $this->t('Select element'),
'#options' => [
'1' => $this->t('One'),
'2' => $this->t('Two'),
'3' => $this->t('Three'),
'4' => $this->t('From New York to Ger-ma-ny!'),
],
];
$form['output'] = [
'#type' => 'textfield',
'#size' => '60',
'#disabled' => TRUE,
'#value' => 'Hello, Drupal!!1',
'#prefix' => '<div id="edit-output">',
'#suffix' => '</div>',
];
$form['submit'] = [
'#type' => 'submit',
'#value' => $this->t('Submit'),
];
return
$form;
}
?>
Комментарии
По-моему, никто не понял, что именно требуется.
'#type' => 'container'