When calling ->filter(function(… how can I reference the actual $page variable within the function ?
Using $page directly returns undefined, I assume because of PHP scope, which would be solved by passing the var as argument to the function… but how to do it in this case? this wild guess…
<?php $myVar = $page->children()->filter(function ($child, $page) {
return ....
});?>
…does not work, I get “Too few arguments to function Kirby\Toolkit\Tpl::{closure}(), 1 passed and exactly 2 expected”
Thank you