Get view runtime values from within a Controller

I create my view runtime values with View.share() in my middleware. I would like to access them in controllers. How (if) can I do this?

I doubt it’s possible…
What’s the use-case you have?

Hey @McSneaky. Well, based on the fact that the values are shared with views I thought it would be logical to be able to have an assess to them via controllers or the like.

If this is not possible with shared values then is this possible with view globals?

My use cases are basic - share currently set locale, some user data, route names etc. like these.

Hmm, now when I think about it… You should be able to do it. Not entirely sure how tho.

Most likely if you take log out view in the http context you could find something in there
Something like this:

// Total pseudocode
// In controller method
async index ({ view }) {
  console.log(view.globals) // Or view.something_else