zf-metal / restful
Doctrine restful for Zend Framework 3
1.4.2
2020-11-05 18:12 UTC
Requires
- php: ^5.6 || 7.1.*
- doctrine/doctrine-orm-module: ^1.0
- gedmo/doctrine-extensions: ^2.4.24
- zendframework/zend-code: ^3.1
- zendframework/zend-crypt: ^3.2
- zendframework/zend-i18n: ^2.7
- zendframework/zend-json: ^3.0
- zendframework/zend-mail: ^2.7.1
- zendframework/zend-mvc: ^3.1
- zendframework/zend-mvc-console: ^1.1
- zendframework/zend-mvc-i18n: ^1.0
- zendframework/zend-mvc-plugin-flashmessenger: ^1.0.0
- zendframework/zend-mvc-plugin-identity: ^1.0
- zf-metal/commons: ^1.3.7
- zf-metal/log: ^1.1.5
Requires (Dev)
- doctrine/data-fixtures: ^1.2.2
- zendframework/zend-developer-tools: ^1.1
- zendframework/zend-test: ^3.2
README
Dependencies
- "doctrine/doctrine-orm-module"
- "zf-metal/commons"
- "zf-metal/log"
- "zendframework/zend-mvc"
- "zendframework/zend-json"
Default Routes
Action: Get 1 item
- Method: GET
- URL: /zfmr/api/entityalias/:id
Action: Get list
- Method: GET
- URL: /zfmr/api/entityalias
Action: Create Item
- Method: POST
- URL: /zfmr/api/entityalias
- Params: Entity Fields & Values
Action: Update Item
- Method: PUT
- URL: /zfmr/api/entityalias/:id
- Params: Entity Fields & Values
Action: Delete Item
- Method: DELETE
- URL: /zfmr/api/entityalias/:id
Custom Routes
You can create your own restful routes and invoke \ZfMetal\Restful\Controller\MainController
<?php
return [
'router' => [
'routes' => [
'zfmcErp' => [
'type' => \Zend\Router\Http\Literal::class,
'mayTerminate' => false,
'options' => [
'route' => '/custom/api',
],
'child_routes' => [
'api' => [
'type' => \Zend\Router\Http\Segment::class,
'mayTerminate' => false,
'options' => [
'route' => '/:entityAlias[/:id]',
'defaults' => [
'controller' => \ZfMetal\Restful\Controller\MainController::class,
],
],
],
],
],
],
]
];
Configure Entities
Add zf-metal-restful.global.php in config/autoload
<?php
return [
'zf-metal-restful.options' => [
'entity_aliases' => [
'alias' => 'entity_class'
]
]
];