물론. 이것은 Action Helpers documentation의 코드 샘플입니다 (Redirector
섹션, 페이지 아래쪽 약 2/3 절 참조). 리디렉터 도우미에 대한 참조를 가져와이 코드가 수행하는 goto*
메서드 중 하나를 호출해야 할 수 있습니다.
class ForwardController extends Zend_Controller_Action
{
/**
* Redirector - defined for code completion
*
* @var Zend_Controller_Action_Helper_Redirector
*/
protected $_redirector = null;
public function init()
{
$this->_redirector = $this->_helper->getHelper('Redirector');
}
public function myAction()
{
/* do some stuff */
// Redirect to 'my-action' of 'my-controller' in the current
// module, using the params param1 => test and param2 => test2
$this->_redirector->gotoSimple('my-action',
'my-controller',
null,
array('param1' => 'test', 'param2' => 'test2'));
}
}
@Andy Shellam을! 어떻게 그럴 수 있겠 어! 정말 고마워! – Moon
위에서 언급 한 Action Helpers 문서가 404 버전을 반환하는 대신 버전 1.12에서 시도해 봅니다 - https://framework.zend.com/manual/1.12/en/zend.controller.actionhelpers.html – PiggyMacPigPig
Zend 3.0.0을 사용하고 내 매개 변수는 리다이렉터 (모듈, 액션, 컨트롤러, 매개 변수)입니다. –