PHP.GT

Latest releases

DomTemplate: Minor bugfixes & PHP 8.1 compatibility

Published on by Greg Bowler

fix: bind multiple attribute placeholders https://github.com/PhpGt/DomTemplate/pull/327

Example: <a href="/path/to/{{project}}/with/{{another}}/attribute/placeholder"> - any attribute can now contain multiple placeholders.

290 default placeholder https://github.com/PhpGt/DomTemplate/pull/328

Example:

Hello, {{name ?? you}}!

fix: resolve deprecation notices https://github.com/PhpGt/DomTemplate/pull/329

PHP 9 will introduce a lot more strict typing, and 8.1 has started emitting deprecation notices. These have all been addressed in this release.

fix: insert template before correct element https://github.com/PhpGt/DomTemplate/pull/330

When template elements have more than one similar siblings, the correct next sibling is remembered, and the template element is inserted in the correct position.

Identify template parents when there are ambiguous XPath selectors https://github.com/PhpGt/DomTemplate/pull/337

Similarly to above, when two or more template elements have similarly-addressed parents, the template element is now always added to the correct one.

Session: Minor type improvement

Published on by Greg Bowler

This minor patch release allows any ArrayAccess object to be used as Config - this is used in WebEngine by passing a ConfigSection object.

Input: PHP 8.1 improvements

Published on by Greg Bowler

New Contributors

Full Changelog: https://github.com/PhpGt/Input/compare/v1.1.2...v1.1.3

Routing: Accept */* if empty accept header

Published on by Greg Bowler

This minor patch is being released to help in situations where WebEngine is being called from a cURL request, but the Accept header is being sent empty. Specifically this helps the Goutte test runner for Behat scripts.

DomTemplate: Select binding by value

Published on by Greg Bowler

Along with some dependency upgrades, the extra functionality introduced in this release allows an HTMLSelectElement to have its value bound, so the relevant HTMLOptionElement is selected. This works using the value attribute whether or not the option has a value - without a value, the textContent of the option will be used.

DomTemplate: Binding tweaks

Published on by Greg Bowler

In this minor patch release, there are two improvements:

  • Table bind attributes like data-template-key are removed during the cleanBindAttributes() call.
  • Strings that contain names of inbuilt PHP functions are not treated as “callable” types when binding values.

DomTemplate: Improvements to table binding with existing content

Published on by Greg Bowler

When a <table> element already exists on the page, it would be useful to utilise the contents of the table, retaining parts of it as a template when binding.

This minor release introduces improvements to help this case:

  • Existing <th> elements that don’t match any bound data are preserved.
  • Bound data that doesn’t match any existing headers is discarded.
  • Importantly: existing <tr> elements can be marked with data-template to add pre-templated row shapes for advanced designs.

DomTemplate: Tidying up

Published on by Greg Bowler

The following tweaks have been made to this minor patch release:

  • null values can now be bound everywhere, without an exception being thrown.
  • Internally, the term Modular has been renamed to Partial to reflect the actual usage and documentation.
  • Another terminology change, cleanBindAttributes is renamed to cleanDatasets to better reflect what the function does.
  • Examples are added to the source code for helping developers get used to the library.

Dom: Add fixes to be compatible with PHP 8.1

Published on by Greg Bowler

Massive thanks to @andrewbess for this improvement to the v2 release.

  • The composer dependencies have been updated to be compatible with PHP 8.1
  • Added fixes for extension have been compatible with PHP 8.1
  • build: normalise dependency versions

Routing: Magic paths match current directory

Published on by Greg Bowler

This minor patch release makes Magic Path matching consistent with WebEngine v3’s usage: if there’s a magic path in the uri-matched directory, it will continue to be matched. Only directories above magic paths will not be matched.

ServiceContainer: Nullable injections

Published on by Greg Bowler

This minor patch release allows nullable types to be requested by the Injector class. This means that if your function parameter has a type such as ?App\User, it will still try to inject the App\User class. This is super useful for WebEngine applications, allowing go functions to simply have a nullable User parameter to indicate whether on not the user is authenticated.