yanot
yanot

Reputation: 353

ZF: using controller forward() method makes init() method fire twice

Is it bug or is it by design? If second, it seems illogical... Why to re-initialise if it is already initialised? Or am I wrong?..

Upvotes: 0

Views: 277

Answers (1)

Adrian World
Adrian World

Reputation: 3128

The $this->_forward() methods works like an internal (3xx) redirect. It's meant to set a new environment like a new request. This will be especially helpful and obvious when you work with modules.

For forwarding to another action inside the same controller you should use $this->dispatch('nextAction').

Upvotes: 2

Related Questions