开发者

Which cases should be used _redirect() or _forward() in Zend Framework [duplicate]

开发者 https://www.devze.com 2023-02-11 04:41 出处:网络
This question already has answers here: Closed 11 years ago. Possible 开发者_运维知识库Duplicate:
This question already has answers here: Closed 11 years ago.

Possible 开发者_运维知识库Duplicate:

What is the difference between redirect and forward in Zend framework

Please provide real and practical examples.


both are totally different things _forward is internal redirection of zf , i.e practically user browser even dont know about this redirection , but inside zf all the hooks after predispatch gets invoked . Whereas in _redirect case user browser takes control of redirection and make second request hence everthing inside zf gets invoked once age (bootstrap , routing etc) .

clearely _forward is less resource intensive then _redirect but if you need the code inside bootstrap to be called (in case you have made changes in config and want it to reload) then you should do _redirect .

0

精彩评论

暂无评论...
验证码 换一张
取 消