2024-09-26 15:46:13 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
class ProjectPage extends Page {
|
|
|
|
|
public function getSteps() {
|
2024-09-26 19:14:20 +02:00
|
|
|
$steps = [];
|
2024-09-26 15:46:13 +02:00
|
|
|
|
2024-09-26 19:14:20 +02:00
|
|
|
foreach ($this->children() as $child) {
|
|
|
|
|
$steps[] = [
|
|
|
|
|
'text' => $child->title()->value(),
|
|
|
|
|
'value' => $child->stepName()->value(),
|
|
|
|
|
'index' => $child->stepIndex()->value(),
|
|
|
|
|
'modified' => $child->modified('Y-MM-dd'),
|
|
|
|
|
'uri' => $child->uri()
|
2024-09-26 15:46:13 +02:00
|
|
|
];
|
2024-09-26 19:14:20 +02:00
|
|
|
}
|
2024-09-26 15:46:13 +02:00
|
|
|
|
2024-09-26 18:46:33 +02:00
|
|
|
usort($steps, function ($a, $b) {
|
|
|
|
|
return $a['index'] <=> $b['index'];
|
|
|
|
|
});
|
|
|
|
|
|
2024-09-26 15:46:13 +02:00
|
|
|
return $steps;
|
|
|
|
|
}
|
|
|
|
|
}
|