Skip to content

Is there any way to use the request without controller #1450

Answered by iammrsea
farshadfahimi asked this question in Help
Discussion options

You must be logged in to vote

Your question is not clear enough, but lemme try pointing out few things.

  1. You don't have access to the request object for a given request-response cycle in a plain class (like your Grid class) without explicitly passing the request object to it. So what you could do in your controller class is to pass the request object to Grid class.
const grid = new Grid(query,request)
  1. So, yeah there is no way you can use it without passing it from a class that has access to it (e.g contoller, middleware)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by farshadfahimi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants