netzmacht/php-dom-manipulator

This package is abandoned and no longer maintained. No replacement package was suggested.

This library is an html dom document manipulator.

1.0.2 2015-08-24 12:22 UTC

This package is auto-updated.

Last update: 2020-04-06 10:40:57 UTC


README

Build Status Version License Downloads

This library provides a rule based dom document manipulator.

Install

This library can be installed using composer

$ php composer.phar require netzmacht/php-dom-manipulator:~1.0
$ php composer.phar update

Usage

<?php 

$converter   = new Netzmacht\DomManipulator\Converter\DomDocumentConverter();
$manipulator = new Netzmacht\DomManipulator\DomManipulator($converter);

$query = new Netzmacht\DomManipulator\Query\XPathQuery('xpath query');
$rule  = new Netzmacht\DomManipulator\Rule\AttributeRule($query, 'class');

$result = $manipulator
    ->addRule($rule)
    ->loadHtml('<html>   </html>')
    ->manipulate();

Credits

This library initially was extracted from the toflar/contao-css-class-replacer which is maintained by Yanick Witschi alias @Toflar.