Skip to content

Releases: PhpGt/DomTemplate

Consistency and stricter types

26 Nov 13:13
Compare
Choose a tag to compare
Pre-release

Consistency has been improved with other PHP.Gt repositories, specifically the use of "contains" over "has" to match other DOM APIs.

Type checking has been made safer with the use of the null coalescing operator rather than emitting warnings or throwing errors.

Bugfixes and improvements

30 Jul 12:49
d4583dd
Compare
Choose a tag to compare
Pre-release
  • Bindable attributes removed more efficiently
  • :empty selector fixed when empty dataset is bound
  • Multiple braced parameters per attribute
  • Always cast bound data to objects (accepting assoc. arrays)
  • Types loosened to allow more compatibility with DOMDocument
  • Existing classes are persisted from custom components

Improved data binding

28 May 22:40
Compare
Choose a tag to compare
Improved data binding Pre-release
Pre-release
  • Do not output -t prefix when XPath name used
  • Carry over classes from source elements when expanding components
  • Clone templates to avoid same templates being reused
  • Inject data into attribute values using braces

Fragments, templates and components improved

07 May 19:13
Compare
Choose a tag to compare
  • DocumentFragment::appendHTML allows HTML5 to be appended to the fragment directly
  • Fix recursive expandComponents when components are nested
  • Looser type checking where document fragments are allowed
  • Edge case tests
  • t- and c- class prefixes normalised

Components made more flexible

23 Mar 22:06
Compare
Choose a tag to compare
Pre-release

Components behave better when mixed with templates.

Notably, a component can be nested within a template element, and its value will be expanded as soon as the template is used, rather than when the template is rendered to the page. This allows the developer to manipulate the contents of the component on-the-fly.

Bindable class lists

09 Jan 10:42
Compare
Choose a tag to compare
Bindable class lists Pre-release
Pre-release

The final planned feature for v1 is now implemented: bindable class lists.

Automatically toggle a class name of an element depending on a truthy value of the dataset.

Improvements to Bindable

07 Jan 19:42
Compare
Choose a tag to compare
Pre-release
  • Optional bind keys with question mark parameter
  • Allow binding of named templates without specifying name
  • Allow templates to be referenced outside of the tree path
  • Unit test coverage improved
  • CodeSniffer warnings resolved

Feature complete

28 Dec 13:53
Compare
Choose a tag to compare
Feature complete Pre-release
Pre-release

All originally scoped features are now implemented, but some real world use-cases must be tested before we get close to a production release.

  • Invalid bind properties are caught
  • Bind attributes are tidied
  • Template attributes are tidied
  • Templates are removed from document

Template elements built up with bind

28 Dec 13:46
Compare
Choose a tag to compare
Pre-release
  • Exceptions thrown when expected bind attribute is not found
  • Data binding on existing elements improved
  • Todo list test written and passing

Data binding

28 Dec 13:44
Compare
Choose a tag to compare
Data binding Pre-release
Pre-release
  • Data is bound on existing elements
  • Bind function split into in-document and in-template
  • More tests