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.
- Host: GitHub
- URL: https://github.com/stoatally/dom
- Owner: stoatally
- Created: 2017-02-22T06:26:06.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-10T00:17:37.000Z (over 8 years ago)
- Last Synced: 2025-08-12T12:42:33.522Z (11 months ago)
- Topics: dom, html, php7, xml
- Language: PHP
- Size: 69.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Document Object Model
Life improving enhancements to the standard PHP DOM.
[](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.