public function StepOneForm::submitForm in TacJS 8
Same name and namespace in other branches
- 8.2 src/Form/Steps/StepOneForm.php \Drupal\tacjs\Form\Steps\StepOneForm::submitForm()
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormInterface::submitForm
File
- src/
Form/ Steps/ StepOneForm.php, line 188
Class
- StepOneForm
- Class StepOneForm.
Namespace
Drupal\tacjs\Form\StepsCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = \Drupal::getContainer()
->get('config.factory')
->getEditable('tacjs.admin_settings_form');
// Get all values and save it in save variable.
$formvalues = $form_state
->getValues();
$formvalues = \Drupal::service('tacjs.settings')
->serializeValuesForm($formvalues);
$config
->set('donnes_step_one', $formvalues);
// Get values fields.
$type_social_networks = $form_state
->getValue('type_social_networks');
$type_video = $form_state
->getValue('type_video');
$type_apis = $form_state
->getValue('type_apis');
$type_commentaire = $form_state
->getValue('type_commentaire');
$type_mesure_audience = $form_state
->getValue('type_mesure_audience');
$type_regie_publicitaire = $form_state
->getValue('type_regie_publicitaire');
$type_support = $form_state
->getValue('type_support');
// Save values.
$config
->set('type_social_networks', $type_social_networks);
$config
->set('type_video', $type_video);
$config
->set('type_apis', $type_apis);
$config
->set('type_commentaire', $type_commentaire);
$config
->set('type_mesure_audience', $type_mesure_audience);
$config
->set('type_regie_publicitaire', $type_regie_publicitaire);
$config
->set('type_support', $type_support);
$config
->save();
// Redirect to step two.
$form_state
->setRedirect('tacjs.step_two');
}