的Zend路由器鏈問題我有一個子域名$siteRoute
:與子域
$siteRoute = new Zend_Controller_Router_Route_Hostname(
':siteSlug.test.com',
array(
'module' => 'site',
),
array('siteSlug' => '^(programming|photography|gaming)$')
);
$router->addRoute('site', $siteRoute);
和我有$ questionRoute的問題看中
$questionRoute = new Zend_Controller_Router_Route(
'questions/:questionId/:questionSlug',
array(
'controller' => 'question',
'action' => 'view',
'questionSlug' => ''
)
);
$router->addRoute('question', $siteRoute->chain($questionRoute));
所有這些兩條路線都沒有任何問題匹配。例如: programming.test.com
site
路線和programming.test.com/questions/132/test-headline
匹配和question
路線匹配。
但是,當我組建一個新的URL用的Zend_View的URL助手或Zend_Router對問題的途徑組裝功能,如它僅返回路徑,而不是域名:
echo $questionRoute->assemble(array('questionId' => 1, 'questionSlug' => 'testing-testing', 'siteSlug' => 'programming'));
呼應questions/1/testing-testing
不programming.test.com/questions/1/testing-testing
。
我怎樣才能做到這一點?