Doing a redirect from the view object

Permalink
I am trying to perform a simple redirect from the view, but I am having trouble finding where Concrete5 keeps its redirect API. I have looked for a while through the view and controller classes, but with little luck, and I am sure that there is an easy answer to this. Anyone know where Concrete5 keeps it?

Thanks,
Mark

 
jordanlev replied on at Permalink Reply
jordanlev
You can't do a redirect from the view -- by the time the view is run, there is already content outputted to the browser (and redirects only work as headers, which must be sent before any content).

You could use a javsacript redirect, which works the same as it does anywhere else (so nothing specific to concrete5). Or you could put the redirect into a page controller (this is a bit more complicated, and really depends on exactly what you're trying to do -- i.e. under what circumstances are you wanting to redirect people and to where do you want to redirect them?)