final-gene/ rest-api-entry-point-module
提供了一个REST资源,它表示API的入口点。
1.1.1
2016-04-02 12:36 UTC
Requires
- php: >=5.5.0
- final-gene/uri-template-module: ^1.0
- rize/uri-template: ^0.3.0
- zendframework/zend-config: ^2.5
- zendframework/zend-modulemanager: ^2.5
- zendframework/zend-mvc: ^2.5
- zendframework/zend-servicemanager: ^2.5
- zfcampus/zf-api-problem: ^1.1
- zfcampus/zf-hal: ^1.3
- zfcampus/zf-rest: ^1.2
Requires (Dev)
- final-gene/phing-commons: ^2.2
- phpunit/phpunit: ^4.8
- zendframework/zend-filter: ^2.5
- zendframework/zend-form: ^2.5
- zendframework/zend-i18n: ^2.5
- zendframework/zend-inputfilter: ^2.5
- zendframework/zend-log: ^2.5
- zendframework/zend-serializer: ^2.5
- zendframework/zend-stdlib: ^2.5
- zendframework/zend-test: ^2.5
- zendframework/zend-validator: ^2.5
This package is auto-updated.
Last update: 2024-09-10 22:39:53 UTC
README
提供了一个REST资源,它表示API的入口点。
安装
当Composer路径可用后,您即可安装此模块。
composer require final-gene/rest-api-entry-point-module
然后,将FinalGene\RestApiEntryPointModule
添加到您的应用程序配置文件中。
配置
您现在可以配置一个虚拟入口点控制器(例如 FinalGene\RestApiEntryPointModule\EntryPointController
),它将实际将FinalGene\RestApiEntryPointModule\Resource\EntryPointResource
映射为监听器。
以下是一个可能的REST配置示例
return [
'zf-rest' => [
'FinalGene\RestApiEntryPointModule\EntryPointController' => [
'listener' => FinalGene\RestApiEntryPointModule\Resource\EntryPointResource::class,
'route_name' => 'api/rest',
'collection_name' => null,
'collection_http_methods' => [
'GET',
],
],
],
];
生成的路由配置可能如下所示
return [
'router' => [
'routes' => [
'api' => [
'type' => 'literal',
'options' => [
'route' => '/api',
'child_routes' => [
'rest' => [
'type' => 'literal',
'options' => [
'route' => '/rest',
'defaults' => [
'controller' => 'FinalGene\RestApiEntryPointModule\EntryPointController',
],
],
],
],
],
],
],
];