private function StepIndicator::createIndicator in Simple multi step form 8
Same name and namespace in other branches
- 8.x src/StepIndicator.php \Drupal\simple_multistep\StepIndicator::createIndicator()
Create indicator.
1 call to StepIndicator::createIndicator()
- StepIndicator::render in src/
StepIndicator.php - Get Indicator.
File
- src/
StepIndicator.php, line 33
Class
- StepIndicator
- Class StepIndicator.
Namespace
Drupal\simple_multistepCode
private function createIndicator() {
$steps_label = [
'#type' => 'item',
'#weight' => -1,
];
$markup = '<div class="multi-steps-label">';
foreach ($this->steps as $step_number => $step) {
$format_settings = $step->format_settings;
if ($format_settings['show_step_title']) {
$active = $this->currentStep == $step_number ? ' active' : '';
$markup .= '<div class="step-label' . $active . '">';
$markup .= $step->label;
$markup .= '</div>';
}
}
$markup .= '</div>';
$steps_label['#markup'] = $markup;
return $steps_label;
}