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

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.


return function ($page) {


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

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?