扩展正则表达式路由

时间:2018-10-13 20:12:25

标签: routing zend-framework3

我正在尝试扩展list = ['A','B','C','D'] 类。我正在创建文件Zend\Router\Http\Regex,并在Application\Router\Http\UnicodeRegex.php中添加了一条路由:

module.onfig.php

但是我收到“致命错误:未捕获的Zend \ ServiceManager \ Exception \ ServiceNotFoundException:在插件管理器Zend \ Router \ RoutePluginManager中找不到名为“ Application \ Router \ Http \ UnicodeRegex”的插件”。

在配置文件中使用我的use Application\Router\Http\UnicodeRegex; ... return [ 'router' => [ 'routes' => [ 'city' => [ 'type' => UnicodeRegex::class, 'options' => [ 'regex' => '/city/(?<city>[\p{L}]+)', 'defaults' => [ 'controller' => Controller\IndexController::class, 'action' => 'city', ], 'spec' => '/city/%city%', ], 'may_terminate' => true, ], ... ], ], ] 类需要做什么?我需要导入什么以及在哪里导入?

0 个答案:

没有答案