I have a structure field which includes the option to upload files:
myStructureField: type: structure fields: images: type: files
How can I create a collection of all files/images uploaded to this field? I need to perform an operation with each file and at the moment I’m solving it with a nested foreach-loop:
<?php foreach($myStructureField as $structure): foreach($images as $image): ?> <!-- Do stuff with the image… --> <?php endforeach; endforeach ?>
I’d like to avoid this and work with a single collection of all files.