开发者

zend framework - is it possible to make a 'redirect' script in the library

开发者 https://www.devze.com 2022-12-17 19:54 出处:网络
Is it possible? How? Let\'s say I have the ff: class My_Redirect { function test() { // 开发者_运维技巧some testing

Is it possible? How?

Let's say I have the ff:

class My_Redirect
{
  function test()
  {
     // 开发者_运维技巧some testing
     // another testing
     // redirect script
  }
}

Thanks in advance!


Yes it is possible, speaking technically. But since the 'controller' part of a MVC application does the request/response handling, I would not recommend it. The library can be seen as part of your 'models'.

If you want to redirect, you can use the controller helper redirector, you can use the Zend_Controller_Response object, or you can use the plain old php header() function (not recommended).

0

精彩评论

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

关注公众号