Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

netzmacht-archive/php-dom-manipulator

Repository files navigation

PHP Dom document manipulator

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.

About

Generic php dom manipulator.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages