0

是否可以使用在控制器中发送 POST/GET 参数

$this->_forward("/url/here");
4

1 回答 1

2
public function fooAction()
{
    // forward to another action in the current controller and module:
    $this->_forward('bar', null, null, array('baz' => 'bogus'));
}

public function barAction()
{
    // forward to an action in another controller:
    // FooController::bazAction(),
    // in the current module:
    $this->_forward('baz', 'foo', null, array('baz' => 'bogus'));
}

public function bazAction()
{
    // forward to an action in another controller in another module,
    // Foo_BarController::bazAction():
    $this->_forward('baz', 'bar', 'foo', array('baz' => 'bogus'));
}

根据手册,您可以使用数组发送参数,应该是最后一个参数。

于 2012-05-19T03:13:50.627 回答