final-gene / uri-template-module
Build URI templates from ZF2 routes
1.2.0
2016-03-23 17:12 UTC
Requires
- php: >=5.5.0
- zendframework/zend-config: ^2.5
- zendframework/zend-modulemanager: ^2.5
- zendframework/zend-servicemanager: ^2.5
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-12-10 23:48:01 UTC
README
Installation
Configure Composer
$ composer require "final-gene/uri-template-module"
Load module
Add FinalGene\UriTemplateModule
to your project's application-config modules
key
Usage
Retrieve the service from the service manager
<?php $uriTemplateService = $serviceManager->get('FinalGene\UriTemplateModule\UriTemplateService')
Use the UriTemplateService via it's public methods
getFromRoute($routeName)
This method takes a route-key (for example api/rest/foo/bar
) and returns a string containing
a templated uri.
getFromResource($resourceName)
This method works exactly like getFromRoute
but it takes a zf-rest
config-key (resource name) instead of a route-key
(for example Vendor\Module\RestController
).