PhpGt / DomTemplate

Bind dynamic data to reusable HTML components.
https://www.php.gt/domtemplate
MIT License
17 stars 4 forks source link

Lists: Support for IteratorAggregate objects #467

Closed g105b closed 1 year ago

g105b commented 1 year ago

IteratorAggregate is amazing! I'm amazed that I haven't ever used it before today.

It allows a class to supply its own Iterator in the getIterator():iterable function. This means a readonly class can supply a new ArrayIterator($this->myArrayList) , which is super useful in the context of binding lists in DomTemplate.