I'm working on a frontend form where i add candidates and add multiple attachments.
The code below works fine with Echo but i want to use return instead. Ofcourse with return the function stops and i end up with only one file returned.
How can i change the code so it will return an array of data or something.
public function showAttatchments(){
$UserId = $this->request->param('ID');
$objects = Bijlage::get()->filter(array(
'connectiemetKandidaatID' => $UserId
));
foreach($objects as $Bijlage ){
$Bestand = File::get()->byID($Bijlage->DocumentID);
echo $Bestand->Filename . $Bijlage->Title;
}
}