2011-03-29 30 views

回答

4

在ZF有Redirector動作助手。它具有可用於訪問外部URL的稱爲gotoUrl()gotoUrlAndExit()的方法。也許這個幫手會適合你的需求。

2
$this->_redirect($url); 

只是把它放在你的行動

6

你可以使用內置的http_build_query PHP函數建立參數,然後養活,爲Zend Framework的gotoUrlAndExit()功能。

$url = "https://external.gateway.com/"; 
$data = array('foo'=>'bar', 
       'baz'=>'boom', 
       'cow'=>'milk', 
       'php'=>'hypertext processor'); 

$query = http_build_query($data); 

$this->_helper->redirector->gotoUrlAndExit($url . '?' . $query); 
+0

謝謝你們awesome..special感謝nvoyageur爲example..u R A真正的節省時間.. – sha 2011-03-31 10:04:59

+0

@sha,如果你喜歡我的答案,請「接受」它,並給它一個給予好評。這將建立你的聲望評分。 – 2011-03-31 12:12:53

相關問題