Baigudin Software avatar
Baigudin Software logo
home
ru region
en region

PHP DOM Builder API 2.0

EOOS Automotive R23-03 is released in version v0.11.0

The third official release of EOOS Automotive that is qualified for POSIX and WIN32 compatible operating systems and based on interfaces designed for EOOS RT – real time operating system.

PHP DOM Builder

Downloaded 40 times

PHP DOM Builder

PHP DOM Builder is a library for generating valid HTML documents and operating those. The library provides friendly application programming interface for changing document type, finding tags by attributes and those values, and also includes methods for parsing web forms.

Download and support

Download

Brief examples

Create and output new HTML document

<?php
$document 
Element::create();
$document->insert('html')->insert('head')->after('body');
echo 
Element::getDocument($document);
?>

Delete a tag with «somenode» value of «id» attribute

<?php
$document
->getElementById('somenode')->remove();
?>

Find tags with «site.com» links in «div» tag with «content» identifier and add a «link» value for its classes

<?php
$document
->find('div#content a[href=site.com]')->addClass('link');
?>

Output an error if the input field value does not match with the regular expression, or characters length exceeds the limit

<?php
$input 
Element::create('input/text')->reg('^[a-z]+$')->maxlength(50);
if( 
$input->check()->error() ) echo $input->errorStr();
?>