function opigno_learning_path_add_form_redirect in Opigno Learning path 8
Same name and namespace in other branches
- 3.x opigno_learning_path.module \opigno_learning_path_add_form_redirect()
Adds redirect after creating new learning path.
1 string reference to 'opigno_learning_path_add_form_redirect'
- opigno_learning_path_form_alter in ./
opigno_learning_path.module - Implements hook_form_alter().
File
- ./
opigno_learning_path.module, line 1596 - Contains opigno_learning_path.module.
Code
function opigno_learning_path_add_form_redirect(array $form, FormStateInterface $form_state) {
$group = $form_state
->getFormObject()
->getEntity();
// If a learning path is created, redirect to the step 2.
if (isset($group)) {
$form_state
->setRedirect('opigno_group_manager.manager.index', [
'group' => $group
->id(),
]);
}
}