public function PoolForm::createNew in CMS Content Sync 2.1.x
Same name and namespace in other branches
- 8 src/Form/PoolForm.php \Drupal\cms_content_sync\Form\PoolForm::createNew()
- 2.0.x src/Form/PoolForm.php \Drupal\cms_content_sync\Form\PoolForm::createNew()
Rebuild form for next step.
Parameters
array $form:
File
- src/
Form/ PoolForm.php, line 114
Class
- PoolForm
- Form handler for the Pool add and edit forms.
Namespace
Drupal\cms_content_sync\FormCode
public function createNew($form, FormStateInterface $form_state) {
$form_state
->setValue('id', 'new');
// If we only use ->setValue() the default value in the input element will still be whatever was selected at the radios.
$data = $form_state
->getUserInput();
$data['id'] = 'new';
$form_state
->setUserInput($data);
$form_state
->setRebuild();
}