Hello,
how to get only the file names without extension ?
$page->files()->filterBy(‘type’, ‘video’)->name
my first controller
<?php
return function($site, $pages, $page) {
$indexData = array();
foreach ($page->files()->filterBy('type', 'video') as $child) {
$indexData[] = $child;
}
$video_collection_count = $page->files()->filterBy('extension', 'mp4')->count();
$random = rand(0,$video_collection_count-1);
return array(
'output' => $indexData[$random]
);
};
?>