Skip to content

Allow passing context node as a query selector string #454

@g105b

Description

@g105b

The $context parameter of bind functions would be enhanced if it would also accept a string: the query selector of the context node. That would mean you wouldn't necessarily need to import the whole HTMLDocument in a go function, for example.

function go(DocumentBinder $binder):void {
    $binder->bindList(["one", "two", "three"], "example-element");
}

rather than:

function go(DocumentBinder $binder, HTMLDocument $document):void {
    $binder->bindList(["one", "two", "three"], $document->querySelector("example-element"));
}

Metadata

Metadata

Assignees

Labels

enhancementNon-breaking improvements to existing behaviour

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions