All notable changes to this project will be documented in this file, in reverse chronological order by release.
-
#4 adds the ability to force both links and embedded resources to be rendered as collections, even if the given relation only contains one item.
To force a link to be rendered as a collection, pass the attribute
__FORCE__COLLECTION__
with a boolean value oftrue
(or use the constantLink::AS_COLLECTION
to refer to the attribute name).To force an embedded resource to be rendered as a collection, pass a boolean
true
as the third argument toembed()
. Alternately, pass an array containing the single resource to any of the constructor,withElement()
, orembed()
.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #1 adds a
Hal\Renderer
subcomponent with the following:Renderer
interfaceJsonRenderer
, for creating JSON representations ofHalResource
instances.XmlRenderer
, for creating XML representations ofHalResource
instances.
-
#1 changes
Hal\HalResponseFactory
to compose aJsonRenderer
andXmlRenderer
, instead of composing$jsonFlags
and creating representations itself.It also makes the response prototype and the stream factory the first arguments, as those will be the values most often injected.
The constructor signature is now:
public function __construct( Psr\Http\Message\ResponseInterface $responsePrototype = null, callable $streamFactory = null, Hal\Renderer\JsonRenderer $jsonRenderer = null, Hal\Renderer\XmlRenderer $xmlRenderer = null ) {
-
#1 changes
Hal\HalResponseFactoryFactory
to comply with the new constructor signature ofHal\HalResponseFactory
. It also updates to check forPsr\Http\Message\ResponseInterface
andPsr\Http\Message\StreamInterface
services before attempting to use zend-diactoros classes.
- Nothing.
- Nothing.
- Nothing.
- Adds keywords to the
composer.json
- Adds a "provides" section to the
composer.json
(provides PSR-13 implementation) - Adds
composer.json
suggestions for:- PSR-11 implementation
- zend-paginator
- Nothing.
- Nothing.
- Nothing.
- Adds documentation; see the doc/book/ tree, or browse at https://weierophinney.github.io/hal/
- Nothing.
- Nothing.
- Nothing.
- Adds the method
templatedFromRoute()
to theLinkGenerator
class. Acts exactly likefromRoute()
, but the generatedLink
instance will have theisTemplated
property toggledtrue
.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Fixes registration of the
MetadataMap
in theConfigProvider
; it was previously using an incorrect namespace.
- Adds
HalResponseFactoryFactory
, a factory for generating aHalResponseFactory
instance.
- Nothing.
- Nothing.
- Nothing.
-
Adds the ability to inject route params and query string arguments at run-time to the route-based metadata instances.
When dealing with route-based metadata, we may be dealing with sub-resources; in such cases, the route parameters may be derived from the request, and we will want to inject them at run-time.
When dealing with collections, the query string arguments may indicate things such as searches, sort directions, sort columns, filters, limits, etc.; these will be derived from the request, and need to be injected at run-time.
- Nothing.
- Nothing.
- Nothing.
Initial Release.
- Everything.
- Nothing.
- Nothing.
- Nothing.