designtopack/public/site/models/project.php
2024-09-26 19:14:20 +02:00

23 lines
No EOL
508 B
PHP

<?php
class ProjectPage extends Page {
public function getSteps() {
$steps = [];
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()
];
}
usort($steps, function ($a, $b) {
return $a['index'] <=> $b['index'];
});
return $steps;
}
}