Redirecting with Zend Framework – part 2

submit to reddit

Recently I posted about the redirecting mechanism of Zend Framework. It’s a working chunk of code but the problem is that it seems quite difficult in according with other ZF sample codes.

Yes the same goal can be achieved with less effort. Like the _forward function which just executes other action/controller, you can call the _redirect method to rewrite the URI.

Just use that in any action of any controller:

$this->_redirect('http://www.example.com');

That executes exactly the same as calling the header PHP method or echoing the <meta> refresher!

Related posts:

  1. Redirecting with Zend Framework
  2. Redirect with Zend Framework
  3. Zend Examples: GET Parameters Default Value

You are a GREAT developer? Click here to answer the weekly quiz!

This entry was posted in micro tutorial, PHP, zend framework and tagged , , , , , . Bookmark the permalink.

2 Responses to Redirecting with Zend Framework – part 2

  1. Qihao says:

    I like the style of your blog. :) And I like Zend Framework, too.

  2. Gaurav says:

    Nothing to say, very good work but there should be a n example.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">