WebBasic CMS
References

wbFromFile()

getting DOM from file

wbFromFile(string $file )

Function is designed to convert a file that contains the HTML code in to the DOM object for later manipulation.

Arguments

$file
path to the file to be converted to DOM

Example

 
<?php 
    $file=$_ENV["path_app"]."/tpl/test.php"; 
    $strig="<div><p class="p1">1</p><p class="p2">2</p></div>"; 
    file_put_contents($file,$string); 
    $obj=wbFromFile($path); 
    $res=$obj->find(".p2)->html(); 
    echo $res; // output value: 2 
?>