« Previous | Next » 

Revision 5781e053

ID5781e053c2f12cee6d7ab89b1717bf4c8cef9684
Parent 29995604
Child 85cac3c9

Added by Dominique Feyer almost 7 years ago

[FEATURE] Support for variables in routing default values

Currently placeholders are only supported in ``name`` and
``uriPattern``.

This adds support for ``default`` values allowing for better reusability
of similar routes. For example a main ``Routes.yaml`` with::

-
name: 'CRUD - product'
uriPattern: '<CRUDSubroutes>'
subRoutes:
'CRUDSubroutes':
package: 'Acme.Package'
suffix: 'Crud'
variables:
'resourceName': 'product'

And the corresponding sub routes ``Routes.Crud.yaml`` with::

-
name: '<resourceName> - index'
uriPattern: '<resourceName>s'
defaults:
'@controller': '<resourceName>'
'@action': 'index'
httpMethods: ['GET']
-
name: '<resourceName> - create'
uriPattern: '<resourceName>s'
defaults:
'@controller': '<resourceName>'
'@action': 'create'
httpMethods: ['POST']
-
name: '<resourceName> - show'
uriPattern: '<resourceName>s/{<resourceName>}'
defaults:
'@controller': '<resourceName>'
'@action': 'show'
httpMethods: ['GET']

Releases: master
Resolves: FLOW-76
Change-Id: I4bfc06d64837d5096734cf9ec0c2988f3180c78a

  • added
  • modified
  • copied
  • renamed
  • deleted