I have no problems with using the controllers but I don’t fully understand why they work.
return function($site, $pages, $page) {
return array(
'nav' => 'Something',
);
};
That is a working controller.
- It return an array with values to the function.
- Then it return the function, but to where? There are no variable to catch it.
The controller below also work:
$test = function($site, $pages, $page) {
return array(
'nav' => 'Something',
);
};
return $test;
For me it’s a little more logical because now I’ve catched the output into $test
.
Return to where?
Then there is a return $test
and what I don’t understand is how it can return it to something. It’s not inside a function, it’s just inside a controller file.