All notable changes to this project will be documented in this file, in reverse chronological order by release.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
-
#70 adds
Zend\Expressive\Helper\Template\TemplateVariableContainer
, which can be used to aggregate template variables within a pipeline, and as a stateless alternative to usingTemplateRendererInterface::addDefaultParam()
. Please review theREADME.me
for more details. -
#70 adds
Zend\Expressive\Helper\Template\TemplateVariableContainerMiddleware
, which will register an emptyTemplateVariableContainer
under that class's name as a request attribute, if one is not already present. -
#70 adds
Zend\Expressive\Helper\Template\RouteTemplateVariableMiddleware
, which will register the return value of any discoveredZend\Expressive\Router\RouteResult
request attribute as the "route" variable of aTemplateVariableContainer
request attribute, when present. This middleware can be used in place of theUrlHelperMiddleware
, as long as you always provide the route name to theUrlHelper
.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #71 changes the visibility of
Zend\Expressive\UrlHelper::getRouteResult()
topublic
, allowing it to be consulted in order to retrieve the matched route name and route parameters.
- Nothing.
- Nothing.
- Nothing.
- #69 adds support for PHP 7.3.
- #68 replaces a ternary using
array_key_exists
with a null coalesce operation as a microoptimization.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #66 updates the
Content-Type
header matching to be more robust, preventing invalid matches.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #64 prevents an unnecessary
json_decode()
call when the request contains no body or an empty body.
- Nothing.
-
#62 modifies the
UrlHelperFactory
to allow specifying both a string$basePath
as well as a string$routerServiceName
to its constructor. This change allows having discrete factory instances for generating helpers that use different router instances and/or which operate under path-segregated middleware. -
#62 modifies the
UrlHelperMiddlewareFactory
to allow specifying a string$urlHelperServiceName
to its constructor. This change allows having discrete factory instances for generating URL helper middleware that use different URL helper instances.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
-
#55 adds support for PSR-15 middleware.
-
#57 adds
Zend\Expressive\Router\ZendRouter\ConfigProvider
and exposes it as a config provider within the package definition.
-
#51 changes a number of signatures to provide scalar type hints, return type hints, and nullable types. Signatures with changes include:
Zend\Expressive\Helper\BodyParams\StrategyInterface
:- The
match()
signature changes tomatch(string $contentType) : bool
- The
parse()
signature changes toparse(ServerRequestInterface $request) : ServerRequestInterface
- The
Zend\Expressive\Helper\ServerUrlHelper
updates its public API to read as follows:__invoke(string $path = null) : string
generate(string $path = null) : string
setUri(UriInterface $uri) : void
Zend\Expressive\Helper\UrlHelper
updates its public API to read as follows:__invoke(?string $routeName = null, array $routeParams = [], array $queryParams = [], ?string $fragmentIdentifier = null, array $options = []) : string
generate(?string $routeName = null, array $routeParams = [], array $queryParams = [], ?string $fragmentIdentifier = null, array $options = []) : string
setRouteResult(RouteResult $result) : void
setBasePath(string $path) : void
getRouteResult() : ?RouteResult
getBasePath() : string
- Nothing.
-
#50 removes support for PHP versions 5.6 and 7.0.
-
#50 and #55 remove support for http-interop/http-middleware of all versions.
- Nothing.
- #46 adds support for http-interop/http-middleware 0.5.0 via a polyfill provided by the package webimpress/http-middleware-compatibility. Essentially, this means you can drop this package into an application targeting either the 0.4.1 or 0.5.0 versions of http-middleware, and it will "just work".
- #46 updates the minimum supported zend-expressive-router version to 2.2.0.
- Nothing.
- Nothing.
- Nothing.
- #45 adds
Zend\Expressive\Helper\ContentLengthMiddleware
. This middleware will inject aContent-Length
response header if none already exists and the response body size is non-null.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- We no longer test against HHVM. Tests were running against that platform prior to this release, but we are no longer testing against it as the PHP versions we support have features that HHVM does not support at this time.
- Nothing.
- Nothing.
- #42 fixes
how the
UrlHelper
generates a URI when using the currently matched route. Previously, doing so would not append either provided query string arguments or fragment identifiers; it now does.
- Nothing.
-
#39 switches from container-interop to psr-container for its
ContainerInterface
usage. This is a breaking change for anybody extending any of the factories, as the typehints will now be different (Psr\Container\ContainerInterface
versusInterop\Container\ContainerInterface
). -
#40 switches all middleware from invokable, double-pass to instead implement http-interop/http-middleware. This means that any extensions of middleware contained in this package will need to be updated; it also means that the middleware can now only be used in systems that support http-interop/http-middleware.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #34 fixes
the signature of
UrlHelper::generate()
to match that ofUrlHelper::__invoke()
, and, more specifically, ensuring that the default$fragment
value isnull
and not''
, fixing a subtle issue when callinggenerate()
without a$fragment
value.
-
#23 adds support to
UrlHelper
for generating a URI based on the currently matched route and parameters. -
#9 updates
UrlHelper
to pass$routerOptions
to the underlying router, if provided.- BREAKING CHANGE: This change adds an optional
$options
parameter to theUrlHelper::__invoke()
andUrlHelper::generate()
methods. Users who have extended this class MUST update the method signatures accordingly to avoid a PHP Fatal Error. If you have not extended this class, no further action is required for compatibility.
- BREAKING CHANGE: This change adds an optional
-
#27 adds query string argument and fragment identifier support to
UrlHelper
.- BREAKING CHANGE: This change adds optional
$routeParams
,$queryParams
, and$fragmentIdentifier
parameters to theUrlHelper::__invoke()
andUrlHelper::generate()
methods, in addition to the aforementioned$options
parameter. Users who have extended this class MUST update the method signatures accordingly to avoid a PHP Fatal Error. If you have not extended this class, no further action is required for compatibility.
- BREAKING CHANGE: This change adds optional
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #29 Don't throw exception on empty JSON body
- #19 FormUrlEncodedStrategy parses raw request bodies, if needed.
- Nothing.
- Nothing.
- #22 updates JsonStrategy test suite to
function with both the
json
andjsonc
extensions
- Nothing.
- Nothing.
- Nothing.
- #21 Respond with 400 on bad JSON input
- Nothing.
- Nothing.
- Nothing.
- #15 URLs
generated by
UrlHelper
will always include the$basePath
if one is set.
- Nothing.
- Nothing.
- Nothing.
- #18 parsing
request body with the
JsonStrategy
will implicitly rewind the stream in order to parse the entire body, rather than just parsing the remaining contents.
- Nothing.
- Nothing.
- #7 removes
the
RouteResultObserverInterface
implementation fromUrlHelper
. This also means that theUrlHelperMiddleware
no longer registers theUrlHelper
as a route result observer, but instead just injects it with theRouteResult
present as a request attribute, if any.
- Nothing.
- #6 adds base
path support to the
UrlHelper
. Middleware may now callUrlHelper::setBasePath()
on an instance to set the path prefix to add to all URIs generated by the helper, which is often useful when working in an environment where the application is in a subdirectory, or where you wish to use a version or locale prefix to all paths. You may clear the base path by passing an empty string to thesetBasePath()
method.
- Nothing.
- Nothing.
- Nothing.
- #3 and
#5 add
a new
Zend\Expressive\Helper\BodyParams\BodyParamsMiddleware
for use in parsing the request body. The middleware consumes strategies, which match against theContent-Type
header, and, if matched, parse the body and return a new request with the parsed body parameters.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #4 adds the
protected method
getRouteResult()
, providing extending classes access to the private$result
member.
- Nothing.
- Nothing.
- Nothing.
- #2 adds the
following classes:
UrlHelperMiddleware
, which accepts aUrlHelper
instance and aRouteResultSubjectInterface
instance; during invocation, it attaches the helper to the subject as an observer.UrlHelperMiddlewareFactory
, which creates aUrlHelperMiddleware
instance from the registeredUrlHelper
andRouteResultSubjectInterface
(orApplication
) instances.
- Nothing.
- #2 removes
registration of the generated
UrlHelper
with theApplication
instance within theUrlHelperFactory
. This change was made to observed race conditions when theUrlHelper
is created within the context of theApplicationFactory
(e.g., when generating aTemplatedErrorHandler
instance).
- Nothing.
- #1 adds a dependency on zendframework/zend-expressive-router, which replaces the dependency on zendframework/zend-expressive. This change means the component can be used without Expressive, and also removes a potential circular dependency issue in consumers of the package.
- Nothing.
- #1 removes the zendframework/zend-expressive, replacing it with a dependency on zendframework/zend-expressive-router.
- Nothing.
Initial release.
Zend\Expressive\Helper\UrlHelper
provides the ability to generate a URI path based on a given route defined in theZend\Expressive\Router\RouterInterface
. If registered as a route result observer, and the route being used was also the one matched during routing, you can provide a subset of routing parameters, and any not provided will be pulled from those matched.Zend\Expressive\Helper\ServerUrlHelper
provides the ability to generate a full URI by passing only the path to the helper; it will then use that path with the currentPsr\Http\Message\UriInterface
instance provided to it in order to generate a fully qualified URI.Zend\Expressive\Helper\ServerUrlMiddleware
is pipeline middleware that can be registered with an application; it will inject aServerUrlHelper
instance with the URI composed in the providedServerRequestInterface
instance.- The package also provides factories compatible with container-interop that can be used to generate instances.
- Nothing.
- Nothing.
- Nothing.