Skip to content

Releases: mcaskill/php-html-build-attributes

v1.3.0

10 Aug 02:16
v1.3.0
2f0390b
Compare
Choose a tag to compare

Complete commits list: v1.2.1...v1.3.0

Summary:

  • Improved support for custom escape functions by passing attribute value and name:
    (string $attribute_value, string $attribute_name): string
  • Moved escape function resolution outside of iteration of attributes to evaluate once.
  • Renamed parameters and variables to improve clarity.

v1.2.1

05 Jul 21:09
v1.2.1
9f81959
Compare
Choose a tag to compare

Complete commits list: v1.2.0...v1.2.1

Summary:

  • Callable attribute value must be a Closure or invokable object. Prevents accidentally calling a function by string name.

v1.2.0

10 May 04:54
Compare
Choose a tag to compare

Complete commits list: v1.1.0...v1.2.0

Summary:

  • Require JSON extension
  • Add support invokable objects as well as closure's for the attribute value.
  • Moved callable attribute value to earlier in case its value is null or a special object.
  • Moved JSON serialization to later in the function for improved variance support.
  • If attribute value is an empty array, the attribute is ignored instead of rendering an empty string attribute.
  • If attribute value is false, the attribute is ignored instead of concatenating an extra space.

v1.1.0

02 Mar 22:26
Compare
Choose a tag to compare

Complete commits list: v1.0.0...v1.1.0

Summary:

  • Updated package to reflect move from gist to repository.
  • Fixed missing support for objects as affirmed in the README.
  • Fixed superfluous spaces from attributes by skipping null values.
  • Added support for boolean values derived from callable values.
  • Added support for numeric values.
  • Trim leading and trailing whitespace from the attribute name.
  • Skip attribute if name is empty.

v1.0.0

02 Mar 22:16
Compare
Choose a tag to compare

Initial release