duanbushi1867
duanbushi1867
2011-02-15 20:55
浏览 23
已采纳

在Zend Framework中应该使用哪些情况_redirect()或_forward()[重复]

Possible Duplicate:
What is the difference between redirect and forward in Zend framework

Please provide real and practical examples.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongwu8064
    dongwu8064 2011-02-15 21:03
    已采纳

    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 .

    点赞 评论

相关推荐