All notable changes to this project will be documented in this file, in reverse chronological order by release.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #60 adds compatibility with twig/twig
^3.0
.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
-
#59 adds Environment configuration options for 'cache', 'debug' and 'strict_variables'.
-
#57 adds support for PHP 7.3.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #53 adds support for the
auto_reload
option to theTwigEnvironmentFactory
. When provided, Twig will recompile a template whenever it detects the source code has changed. This option should be disabled in production.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
-
#50 updates an exception message thrown in the
TwigExtensionFactory
to be more consistent with other exceptions raised in the component. -
#51 updates the minimum support twig versions to
^1.34
and^2.4
. -
#51 modifies all functionality to use namespaced versions of all Twig classes. Users may still reference classes using the previously supported pseudo-namespaces, as they are class aliases for the namespaced versions.
- Nothing.
- Nothing.
- Nothing.
-
#46 adds two new configuration options (under the
twig
top-level configuration key) for theTwigEnvironment
:-
optimizations
allows enabling or disabling optimizations, and may be the integer-1
(enable all optimizations) or0
(disable optimizations); the default is-1
. -
autoescape
allows specyfing the auto-escaping strategy to use, and may be one of html, js, css, url, html_attr, or false; the default is "html".
-
- Nothing.
- Nothing.
- Nothing.
- Nothing.
-
#36 and #42 add support for zend-expressive-template v2, zend-expressive-router v3, and zend-expressive-helpers v5.
-
#38 adds a
ConfigProvider
class with default service wiring and configuration for the component. It also updatescomposer.json
to addextra.zf.config-provider
configuration to notify zend-component-installer of the shippedConfigProvider
class, allowing the plugin to inject theConfigProvider
in your application configuration during initial installation.
-
#43 adds a TwigExtensionFactory so the TwigExtension can be customized.
If you have the ConfigProvider in your
config\config.php
file, this factory is added for you. If you don't use the ConfigProvider, you need to add this to your config:'dependencies' => [ 'factories' => [ TwigExtension::class => TwigExtensionFactory::class, ], ],
-
#36 updates all code to add scalar and return type hints, including nullable types and void types, wherever they make sense. As such, if you are extending any classes from this component, you may need to check any signatures you override.
-
#37 updates the package
ExceptionInterface
to extend from theExceptionInterface
provided in zend-expressive-template.
- Nothing.
-
#36 removes support for PHP versions prior to PHP 7.1.
-
#36 removes support for zend-expressive-template releases prior to v2.
-
#36 removes support for zend-expressive-router releases prior to v3.
-
#36 removes support for zend-expressive-helpers releases prior to v5.
- Nothing.
- #30 adds support for the PSR-11 Container Interface.
- #33 removes duplicate code.
- Nothing.
- Nothing.
- Nothing.
- #29 adds support for zend-expressive-helpers 4.0.
- Nothing.
- Nothing.
- Nothing.
-
#28 adds support for Twig 2.1. If you upgrade and receive this version, please be aware that Twig 2.X no longer allows short name "aliases" for extensions. As an example, the following works in Twig 1.X:
$environment->getExtension('core');
but does not work in Twig 2.X, where you would instead need to use the fully qualified class name:
$environment->getExtension(Twig_Extension_Core::class);
As the latter notation has worked across both versions, you may want to consider making that change before upgrading, if you were using the older notation.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #26 fixes the zend-expressive-router constrain in composer.json.
-
#12 adds the ability to provide a default timezone to use with Twig. Provide it via the
twig.timezone
setting:return [ 'twig' => [ 'timezone' => 'America/Chicago', ], ];
-
#15 extracts a new factory,
TwigEnvironmentFactory
, from theTwigRendererFactory
. This new factory is now responsible for creating and configuring theTwig_Environment
instance.While users may continue to use existing configuration, which omits registration of the
Twig_Environment
service with this new factory, doing so now emits a deprecation notice, indicating they should update their dependency configuration.This also means that users may override the
Twig_Environment
service to provide alternate instantiation of that class, or add delegator factories in order to further configure the Twig environment. -
#23 adds the ability to provide Twig runtime loaders via configuration. These may be provided as either instances or service names, under the
twig.runtime_loaders
setting:return [ 'twig' => [ 'runtime_loaders' => [ // runtime loader service names or instances of // Twig_RuntimeLoaderInterface ], ], ];
-
#18 adds support for zend-expressive-helpers 3.0.
-
#18 adds support for zend-expressive-router 2.0.
-
#18 adds new parameters to the included
path()
extension. It now accepts the following arguments:{{ path( 'route_name', {'route_param': 'substitution'}, {'query_param': 'value'}, 'fragment', {'reuse_result_params': false} ) }}
The new arguments are the query parameters, fragment, and router options.
- Nothing.
- This release removes support for PHP 5.5.
- #19
fixes how the factories test for prior registration of an extension.
Previously, they pulled the extension name using the extension's
getName()
method; however, as of Twig 1.26, that method is deprecated fromTwig_ExtensionInterface
, and no longer used internally. This package's factories now use the class name of the extension to perform the checks.
- Nothing.
- Nothing.
- Nothing.
- #11
updates the
TwigExtension
class to implementTwig_Extension_GlobalsInterface
, which is required starting with Twig 1.23 for forwards-compatibility.
-
#8 adds
zendframework/zend-expressive-helpers
as a dependency, in order to consume itsUrlHelper
andServerUrlHelper
implementations.Adds the
url
andabsolute_url
twig functions to generate absolute urls for a route and path. -
#10 adds config globals to pass to all twig templates.
'twig' => [ 'cache_dir' => 'path to cached templates', 'assets_url' => 'base URL for assets', 'assets_version' => 'base version for assets', 'extensions' => [ // extension service names or instances ], 'globals' => [ // Global variables passed to twig templates 'ga_tracking' => 'UA-XXXXX-X' ], ],
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #9
fixes a skipped test, and updates the behavior of
TwigRendererFactory
to raise an exception if the 'config' service is not an array orArrayObject
.
First stable release.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #5
fixes an issue in the TwigRendererFactory whereby it failed if the 'config'
service returned an
ArrayObject
. It now validates that it has a usable config value, raising an exception when it does not.
-
#1 adds the ability to inject additional Twig extensions via configuration. This can be done using the following configuration:
'templates' => [ 'extension' => 'file extension used by templates; defaults to html.twig', 'paths' => [ // namespace / path pairs // // Numeric namespaces imply the default/main namespace. Paths may be // strings or arrays of string paths to associate with the namespace. ], ], 'twig' => [ 'cache_dir' => 'path to cached templates', 'assets_url' => 'base URL for assets', 'assets_version' => 'base version for assets', 'extensions' => [ // extension service names or instances ], ],
### Deprecated
- [#1](https://github.com/zendframework/zend-expressive-twigrenderer/pull/1)
deprecates usage of the `cache_dir` and `assets_*` sub-keys under the
`templates` top-level key, in favor of positioning them beneath a `twig`
top-level key. As `templates` and `twig` values are merged, however, this
change should not affect end-users.
### Removed
- Nothing.
### Fixed
- [#4](https://github.com/zendframework/zend-expressive-twigrenderer/pull/4)
removes the dependency on zendframework/zend-expressive, and replaces it with
zend-framework/zend-expressive-template and
zendframework/zend-expressive-router.
## 0.2.1 - 2015-11-10
### Added
- Nothing.
### Deprecated
- Nothing.
### Removed
- Nothing.
### Fixed
- [#3](https://github.com/zendframework/zend-expressive-twigrenderer/pull/3)
updates the `renderAssetUrl()` method of the `TwigExtension` to mask
versioning if it's empty (while also allowing zero versions).
## 0.2.0 - 2015-10-20
### Added
- Nothing.
### Deprecated
- Nothing.
### Removed
- Nothing.
### Fixed
- Updated to zend-expressive RC1.
- Added branch-alias of dev-master to 1.0-dev.
## 0.1.0 - 2015-10-10
Initial release.
### Added
- Nothing.
### Deprecated
- Nothing.
### Removed
- Nothing.
### Fixed
- Nothing.