designtopack/public/site/models/project.php

20 lines
440 B
PHP
Raw Normal View History

2024-09-26 15:46:13 +02:00
<?php
class ProjectPage extends Page {
public function getSteps() {
$steps = array_map(function($child) {
return [
'text' => $child['content']['title'],
'value' => $child['content']['stepname'],
'index' => $child['content']['stepindex']
2024-09-26 15:46:13 +02:00
];
}, $this->children()->toArray());
2024-09-26 15:46:13 +02:00
usort($steps, function ($a, $b) {
return $a['index'] <=> $b['index'];
});
2024-09-26 15:46:13 +02:00
return $steps;
}
}