...
public function title() {
return get_the_title();
}
...
app/View/Composers/Content.php
...
public function title() {
return get_the_title();
}
...
This is an extremely rudimentary example, and there are better ways of doing the title specifically, but this would get the correct title in each case, so it acts like a Sage 9 static controller function.
I haven’t tested this inside the loop, but you can return anonymous functions as variables and then execute them in your blades. Since iirc the loop relies on global state they should work. i.e.: