public function ContentImport::submitForm in Content Import 8.9
Same name and namespace in other branches
- 8 src/Form/ContentImport.php \Drupal\contentimport\Form\ContentImport::submitForm()
- 8.3 src/Form/ContentImport.php \Drupal\contentimport\Form\ContentImport::submitForm()
- 8.4 src/Form/ContentImport.php \Drupal\contentimport\Form\ContentImport::submitForm()
Content Import Form Submission.
Overrides ConfigFormBase::submitForm
File
- src/
Form/ ContentImport.php, line 141
Class
- ContentImport
- Configure Content Import settings for this site.
Namespace
Drupal\contentimport\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$content_type = $form_state
->getValue('contentimport_contenttype');
$import_type = $form_state
->getValue('contentimport_importtype');
// import_node($this->file, $content_type, $import_type);.
$batch = [
'title' => $this
->t('Importing Content'),
'operations' => [
[
'import_node',
[
$this->file,
$content_type,
$import_type,
],
],
],
'init_message' => $this
->t('Importing...please wait'),
'progress_message' => $this
->t('Processed @current out of @total.'),
'finished' => 'import_success',
];
batch_set($batch);
}