Can redirection in symfony2 only be done in the controller controller? Is it not possible if it is in a file other than the controller? If it is possible, please let me know if someone knows.
You can use js’s window.location to jump to the page
In a file other than the controller? The master’s needs are somewhat different. . . It is recommended that the logic of page jump is placed in the Controller, because the page jump is also a Response and must be returned within the Controller. Another point is that page jumps are placed everywhere. If you jump here and there, you will not know where to jump. . . If the masturbator really wants to jump, just header.
In- Controller, the master already knows
- You can use js’s window.location to jump to the page
- In a file other than the controller? The master’s needs are somewhat different. . . It is recommended that the logic of page jump is placed in the Controller, because the page jump is also a
Response
and must be returned within the Controller. Another point is that page jumps are placed everywhere. If you jump here and there, you will not know where to jump. . . If the masturbator really wants to jump, just header.Don’t be bound by the framework, come to the original how to use symfony2 or how to jump
window.location
Everything is fine