私は多言語の Zend プロジェクトを開発しています。イベントを作成しているので、次のような構造を使用したい:
- domain.com/event/2010/ => 2010 年のイベント
- domain.com/event/2010/11/ => 2010 年 11 月のイベント
- domain.com/event/2010/11/23/ => 2010 年 11 月 23 日のイベント
このポピュズのために、次のルートを作成しました。
$router->addRoute('event', new Zend_Controller_Router_Route_Regex('event/(\d+)(/(\d+)(/(\d+))?)?', array(
'module' => 'public',
'controller' => 'event',
'action' => 'show'
)));
$router->addRoute('eventLang', new Zend_Controller_Router_Route_Regex(':language/event/(\d+)(/(\d+)(/(\d+))?)?', array(
'language'=>'en'
'module' => 'public',
'controller' => 'event',
'action' => 'show'
)));
最初のものは完璧に機能します。2 つ目は、「action 2010 does not exist」のようなエラーを表示します。ここで何が問題ですか?