Zend Frameworkで私のカスタムルートの定義をどのように短くすることができますか?私は現在この定義を持っています:Zend Frameworkのルート定義を短くする
$route = new Zend_Controller_Router_Route(
":module/:id",
array(
"controller" => "index",
"action" => "index"
),
array("id" => "\d+")
);
self::$frontController->getRouter()->addRoute('shortcutOne', $route);
$route = new Zend_Controller_Router_Route(
":module/:controller/:id",
array("action" => "index"),
array("id" => "\d+")
);
self::$frontController->getRouter()->addRoute('shortcutTwo', $route);
$route = new Zend_Controller_Router_Route(
":module/:controller/:action/:id",
null,
array("id" => "\d+")
);
self::$frontController->getRouter()->addRoute('shortcutThree', $route);
これらのルールをうまく組み合わせる方法はありますか? これはどこに置くのがベストプラクティスですか?私は現在、フロントコントローラの初期化の直後にブートストラップクラスにそれらを持っています。
ありがとうございました。私はあなたのブートストラップをスリムに保つためにconfigを使用します:) –