public function CourseManageForm::submitForm in Course 8.3
Same name and namespace in other branches
- 8.2 src/Form/CourseManageForm.php \Drupal\course\Form\CourseManageForm::submitForm()
- 3.x src/Form/CourseManageForm.php \Drupal\course\Form\CourseManageForm::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/ CourseManageForm.php, line 47
Class
Namespace
Drupal\course\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$course = $form_state
->getBuildInfo()['args'][0];
$collection = 'config.entity.key_store.course';
$name = 'course:' . $course
->id();
$kv = Drupal::keyValue($collection);
$course_settings = $kv
->get($name);
$form_state
->cleanValues();
foreach ($form_state
->getValues() as $key => $value) {
$course_settings[$key] = $value;
}
$kv
->set($name, $course_settings);
}