Passing $page to a collection within 'site/collections'

#1

Can I get $page dynamically in a collection under site/collections ?
I am trying to pass $page as a parameter but I am getting a “page parameter is missing” exception.

<?php

return function ($page) {

Thanks

#2

No, that’s not possible. What is your use case?

#3

Building this collection takes too much code to be on the template, so I thought, let’s put it under site/collections, but if $page does not work there I guess I have to move this to a page controller instead?

Thanks