Roots Discourse

Equivalent of App\sage('blade')->share in Sage 10?

I use to find it pretty helpful to be able to use add_filter('template_redirect') and include an array of data which can be accessed in the relevant Blade templates using App\sage('blade')->share($data);

Is there an equivalent for Sage 10? So it doesn’t return a view, but rather exposes an array of data to Blade?

\Roots\view()->share($data) should work – otherwise, you can return data globally as seen in App.php

1 Like

Thanks - that works perfectly.

This topic was automatically closed after 42 days. New replies are no longer allowed.