perfectin / api
用于创建API的TYPO3 Flow包
1.0
2016-02-10 21:36 UTC
Requires
- typo3/flow: *
This package is not auto-updated.
Last update: 2024-09-14 18:53:01 UTC
README
是一个TYPO3.Flow包,用于为现有代码创建API
示例路由
通过REST查找所有TYPO3\Flow\Security\Role
Routes.yaml
-
name: 'Rest route for Roles'
uriPattern: role
httpMethods:
- GET
defaults:
'@package': PerfectIn.Api
'@controller': Rest
'@action': handle
class: TYPO3\Flow\Security\Policy\PolicyService
method: getRoles
通过REST查找一个TYPO3\Flow\Security\Role
注意,URL中的变量{roleIdentifier}会自动映射到
getRole
方法中的参数$roleIdentifier
Routes.yaml
-
name: 'Rest route for Role'
uriPattern: 'role/{roleIdentifier}'
httpMethods:
- GET
defaults:
'@package': PerfectIn.Api
'@controller': Rest
'@action': handle
class: TYPO3\Flow\Security\Policy\PolicyService
method: getRole