designtopack/public/site/models/project.php

20 lines
No EOL
440 B
PHP

<?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']
];
}, $this->children()->toArray());
usort($steps, function ($a, $b) {
return $a['index'] <=> $b['index'];
});
return $steps;
}
}