public static function ShsTermSelect::addDepthLevelSubmit in Webform Simple Hierarchical Select 8
Ajax submit callback for depth labels.
Parameters
array $form: Form array.
\Drupal\Core\Form\FormStateInterface $form_state: Form state object.
File
- src/
Plugin/ WebformElement/ ShsTermSelect.php, line 153
Class
- ShsTermSelect
- Provides a 'webform_shs_term_select' Webform element.
Namespace
Drupal\webform_shs\Plugin\WebformElementCode
public static function addDepthLevelSubmit(array $form, FormStateInterface $form_state) {
$current_total = $form_state
->get('depth_labels_total_items') ?: 1;
$form_state
->set('depth_labels_total_items', $current_total + 1);
$form_state
->setRebuild(TRUE);
}