Created
January 26, 2016 17:23
-
-
Save bwaidelich/8769f645ab5f71454d3c to your computer and use it in GitHub Desktop.
Example for reusable REST/CRUD sub routes (For the Flow application framework)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- | |
name: 'NewAction' | |
uriPattern: 'new' | |
defaults: | |
'@action': 'new' | |
httpMethods: [GET] | |
- | |
name: 'CreateAction' | |
uriPattern: 'create' | |
defaults: | |
'@action': 'create' | |
httpMethods: [POST] | |
- | |
name: 'UpdateAction' | |
uriPattern: 'update' | |
defaults: | |
'@action': 'update' | |
httpMethods: [POST,PUT] | |
- | |
name: 'EditAction' | |
uriPattern: '{<entityName>}/edit' | |
defaults: | |
'@action': 'edit' | |
httpMethods: [GET] | |
- | |
name: 'DeleteAction' | |
uriPattern: '{<entityName>}/delete' | |
defaults: | |
'@action': 'delete' | |
httpMethods: [POST,DELETE] | |
- | |
name: 'ShowAction' | |
uriPattern: '{<entityName>}' | |
defaults: | |
'@action': 'show' | |
httpMethods: [GET] | |
- | |
name: 'IndexAction' | |
uriPattern: '' | |
defaults: | |
'@action': 'index' | |
appendExceedingArguments: TRUE | |
httpMethods: [GET] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Products | |
- | |
name: 'Products' | |
uriPattern: 'products/<CRUDSubRoutes>' | |
defaults: | |
'@package': 'Some.Package' | |
'@controller': 'Product' | |
'@format': 'html' | |
routeParts: | |
'product': | |
objectType: 'Some\Package\Domain\Model\Product' | |
subRoutes: | |
'CRUDSubRoutes': | |
package: 'Some.Package' | |
suffix: 'CRUD' | |
variables: | |
'entityName': 'product' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
great work!