0
起初對不起我的英文不好。 我想處理與我的路線不匹配的所有請求到CustomPageController
。Zend路由(默認控制器處理所有url)
我想配置我module.config.php
這樣的:
'defaults' => array(
'type' => 'Zend\Mvc\Router\Http\Literal',
'options' => array(
'route' => '/*', // or 'route' => '/user*' for example, to handling www.site.com/user4 (just as example)
'defaults' => array(
'controller' => 'custom_page',
'action' => 'index',
),
),
),
來處理不匹配的路由必須重定向到我的最後一個「默認」路由的所有查詢。但它不起作用。
您可以發佈自定義頁面控制器嗎? –
CustomPageController只有indexAction(){}和echo 123;死;現在。 – Nikoole
我認爲你的控制器名稱是CustomPageController,並且在你的module.config.php中你調用了custom_page,所以我認爲你必須用CustomPage替換它,如果需要的話,還要使用完整路徑。 –