Answer the question
In order to leave comments, you need to log in
How to make controllers with flexible Response?
very often different results are needed from project to project - one project needs render, another redirect in the third JsonResponse, and so on,
you have to redefine controllers in each project, and only the last couple of lines of action functions,
what do you advise?
Thank you
Answer the question
In order to leave comments, you need to log in
change the response depending on some parameter? (get, post is not important and add a switch case construction on it)
or, yes, you can use events to modify the response object for your purposes in the project - but in this case you will have to write a handler, from the obvious pluses - it will allow you to transfer some common part to vendors and modify, as needed, only the event handler
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question