php-extended / php-html-transformer-comment-filter
A filter for html trees that removes cdata nodes.
Installs: 3 639
Dependents: 1
Suggesters: 0
Security: 0
pkg:composer/php-extended/php-html-transformer-comment-filter
Requires
Requires (Dev)
README
A filter for html trees that removes comment nodes.
Installation
The installation of this library is made via composer.
Download composer.phar
from their website.
Then add to your composer.json :
"require": {
...
"php-extended/php-html-transformer-comment-filter": "^3",
...
}
Then run php composer.phar update
to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
Basic Usage
To filter a dom node, do the following :
use PhpExtended\HtmlTransformerCommentFilter;
/* @var $dom \PhpExtended\Html\HtmlAbstractNodeInterface */
$filter = new HtmlTransformerCommentFilter();
$filtered = $filter->transform($dom);
// $filtered instanceof \PhpExtended\Html\HtmlAbstractNodeInterface
// but without comment nodes
License
MIT (See license file).