‘options’ => [
‘title’ => ‘Color and steps’,
‘children’ => [
[
‘type’ => ‘component.progress-bar’,
‘options’ => [
‘value’ => [
‘current’ => 5,
‘max’ => 10
],
‘steps’ => 3,
‘color’ => ‘color1’
]]]]];

// Example usage:
// You can access the values like this:
$sectionTitle = $section[‘options’][‘title’];
$progressBar = $section[‘options’][‘children’][0];
$currentValue = $progressBar[‘options’][‘value’][‘current’];
$maxValue = $progressBar[‘options’][‘value’][‘max’];
$steps = $progressBar[‘options’][‘steps’];
$color = $progressBar[‘options’][‘color’];

// Or you could process this configuration to render actual HTML components
function renderSection($sectionConfig) {
$html = ‘

‘;
$html .= ‘

‘ . htmlspecialchars($sectionConfig[‘options’][‘title’]) . ‘

‘;

foreach ($sectionConfig[‘options’][‘children’] as $child) {
if ($child[‘type’] === ‘component.progress-bar’) {
$options = $child[‘options’];
$percentage = ($options[‘value’][‘current’] / $options[‘value’][‘max’]) * 100;
$html .= ‘

‘;
$html .= ‘
‘;
$html .= ‘‘ . $options[‘value’][‘current’] . ‘/’ . $options[‘value’][‘max’] . ‘‘;
$html .= ‘

‘;
$html .= ‘

Steps: ‘ . $options[‘steps’] . ‘

‘;
$html .= ‘

‘;
}
}

$html .= ‘

‘;
return $html;
}

echo renderSection($section);
?>

Please enable JavaScript in your browser to complete this form.
Planning - Step 1 of 5
Your Project
i

Please select what type of extension are you looking to do. Different types of extensions require different details of the drawings produced and are priced accordingly.

Select Your Project