2011-02-18 162 views
1

我在我的應用程序中定義了幾條路由。 當路由A匹配並且我使用路由B組裝URL而不重置時,它不包含當前的請求參數。Zend框架路由參數

當通過與當前路線不同的路線組裝URL時,是否有簡單的方法來包含所有請求參數? 我看過Zend_Controller_Router_Rewrite-> useRequestParametersAsGlobal,但是當(顯然)reset = true時,它也會包含請求參數。

+1

你使用`url` helper嗎?如果是,請顯示代碼如何操作。 – singles 2011-02-18 15:36:43

回答

0

您可以嘗試以下操作。

$oldParams = $this->_getAllParamas(); 
unset($oldParams['module']); 
unset($oldParams['controller']); 
unset($oldParams['action']); 

array_merge(array('new'=>'param'),$oldParams) 

到您的網址視圖助手。