0
スラッグでCMSからページコンテンツを取得するには、1つのルートが必要です。私は次のような設定を簡単に作成できると思っていましたが、ルート上の複数の部分でしか動作しないようです。私の計画はカスタムルートを作成することでしたが、システムルートと一致しない場合は、自分のカスタムルートを取得するとは思いません:)スラッグ付きZF2/3キャッチオールルート
これを行う方法はありますか?
が
'router' => [
'routes' => [
'cms' => [
'type' => \Zend\Router\Http\Segment::class,
'options' => [
'route' => '/:slug',
'defaults' => [
'controller' => \Cms\Controller\PageController::class,
'action' => 'index'
]
]
]
]
];
作品
'router' => [
'routes' => [
'cms' => [
'type' => \Zend\Router\Http\Segment::class,
'options' => [
'route' => '/test/:slug', // <-- Here is the change
'defaults' => [
'controller' => \Cms\Controller\PageController::class,
'action' => 'index'
]
]
]
]
];