私のシステムには、同じコードスタイルを使用してモジュールを開発できるグローバルな動的ルートがあります。 URLのブレッドクラムを/checkout/list/cart-type/2
のように生成したいのに、ナビゲーション設定が自分のURLと一致しない。ZF2がブレッドクラム用の動的ワイルドカードルートに一致しません
一方、私が単に/checkout/list
にルーティングすると、正しく動作します。
設定を正しく設定してください。
私のルータの設定
'router' => [
'routes' => [
'default' => [
'type' => 'Segment',
'options' => [
'route' => '/[:controller[/[:action]]]', // global route
'constraints' => [
'controller' => '[a-zA-Z]?[a-zA-Z0-9_-]*',
'action' => '[a-zA-Z]?[a-zA-Z0-9_-]*',
],
'defaults' => [
'controller' => 'index',
'action' => 'index',
],
],
'may_terminate' => true,
'child_routes' => [
'wildcard' => [
'type' => 'Wildcard',
'priority' => 10,
'options' => [],
],
],
],
],
],
マイナビ設定
'navigation' => [
'default' => [
'checkout' => [
'module' => 'checkout',
'label' => 'Home',
'route' => 'default',
'controller' => 'index',
'action' => 'index',
'pages' => [
'checkout-list' => [
'label' => 'Invoices',
'route' => 'default/wildcard',
'controller' => 'checkout',
'action' => 'list',
'params' => [
'cart-type' => 2
],
],
],
],
],
],
再定義「ID」の子セグメントルートにルート '/チェックアウト/リスト/カート型/ 2 '正しくルータによってハンドルでましたか? –