An open API service indexing awesome lists of open source software.

https://github.com/stoatally/dom

Life improving enhancements to the standard PHP DOM.
https://github.com/stoatally/dom

dom html php7 xml

Last synced: 6 months ago
JSON representation

Life improving enhancements to the standard PHP DOM.

Awesome Lists containing this project

README

          

# Document Object Model

Life improving enhancements to the standard PHP DOM.

[![Build Status](https://secure.travis-ci.org/stoatally/dom.svg?branch=master)](http://travis-ci.org/stoatally/dom)

## Install

The recommended way to install Text Expressions is [through composer](http://getcomposer.org).

```JSON
{
"require": {
"stoatally/dom": "0.*"
}
}
```

## Usage

Create a document factory:

```php
use Stoatally\Dom\DocumentFactory;

$factory = new DocumentFactory();
```

Set the text content of a node:

```php
$document = $factory->createFromString('

');
$document->select('p')->setContents('PHP <3');
// >

PHP <3


```

For more comprehensive examples see the [examples](./examples) and [tests](./tests) directories.