2009年9月14日星期一

[fw-mvc] _forward()

Hi all

If I _forward() to another controller / action, does the current controller need to have an action by the same name?

I'm getting a "not trapped by __call" exception in the following situation:

class OneController extends Zend_Controller_Action
{
 public function indexAction()
 {
  echo 'OneController::indexAction()';
  $this->_forward('view', 'two');
 }
}

class TwoController extends Zend_Controller_Action
{
 public function viewAction()
 {
  echo 'TwoController::viewAction()';
 }
}

If I add viewAction() to OneController, it does the redirect fine.

Using ZF 1.9.2.

- Neil

没有评论: