Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing context node as a query selector string #454

Open
g105b opened this issue Sep 3, 2023 · 0 comments
Open

Allow passing context node as a query selector string #454

g105b opened this issue Sep 3, 2023 · 0 comments

Comments

@g105b
Copy link
Member

g105b commented Sep 3, 2023

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"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

1 participant