You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I implemented getElementById($id) (936d22c) and getElementsByTagName($tagName) (2283a21). They behave exactly like their JavaScript counterparts.
Example:
$image = SVGImage::fromFile('file.svg');
$doc = $image->getDocument();
$byId = $doc->getElementById('foobar');
// $byId is now set to the element with id="foobar"$byTagName = $doc->getElementsByTagName('rect');
// $byTagName is now set to an array with all <rect /> nodes
Note that getElementById can only be invoked on the document (as usual, since ids are unique across the document). getElementsByTagName can be invoked on any node.
Does it exists a feature which allows to search nodes by type and id in the svg dom?
The text was updated successfully, but these errors were encountered: