PHP Classes

HTML Manipulation like jQuery: Manipulate HTML documents using CSS selectors

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 421 All time: 6,388 This week: 455Up
Version License PHP version Categories
domfss 1.0Public Domain5.3HTML, PHP 5
Description 

Author

This package can manipulate HTML documents using CSS selectors.

It can load HTML documents as a DOM node structure and use CSS selectors to find document elements.

Picture of Mohamad Mohebifar
Name: Mohamad Mohebifar <contact>
Classes: 1 package by
Country: Iran Iran

 

Details

Consider Example1.php The HTML content is : __________________________________ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <meta name="generator" content="FSS DOM Object"> <title>My Test</title> </head> <body> <div id="biography"> Hello ! I am Mohamad Mohebifar from iran and i was born in 1993. I study Chemistry & IT at Shahid Beheshti University. </div> <p> I present this class to FSS ! ? </p> <div class="myframework"> Test </div> </body> </html> __________________________________ but with DOM object we made some changes and now the result is : __________________________________ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <meta name="generator" content="FSS DOM Object"> <title>My Test</title> </head> <body> <div id="biography" title="My Auto Biography" style="background: yellow;"> Hello ! I am Mohamad Mohebifar from iran and i was born in 1993. I study Chemistry & IT at Shahid Beheshti University. </div> <p class="myPrivacy"> I present this class to FSS ! ♥ You know !</p> <div class="myframework"> Test <br>this is appended from a cloned node : Hello ! I am Mohamad Mohebifar from iran and i was born in 1993. I study Chemistry & IT at Shahid Beheshti University. </div> </body> </html> __________________________________ with this code we make document from html string content : pQuery::createDocFromHTML($html); and now we select an element using CSS Selector pQuery::select("p") then we can do somework with it !! like jQuery ->addClass('myPrivacy')->append("You know !") as you see in the result content, we have : <p class="myPrivacy"> FSS stands for my love's name. I present this class to FSS ! ♥ You know !</p> while the source was : <p> FSS stands for my love's name. I present this class to FSS ! ? </p> now we can add css style, append some text, prepend text, set attribute, get attribue, clone, get inner html, set inner html, add or remove class, check existing class and destroy node ! PHPDoc is prepared for you. just use a good IDE that supports PHPDoc.

  Files folder image Files (24)  
File Role Description
Files folder imageCssSelector (6 files, 2 directories)
Files folder imageDOM (2 files)
Image file coding_sample.jpg Screen sample of codes
Image file Example1.jpg Screen Screenshot from before and after effects of this class on example1
Plain text file example1.php Example Example with ready html
Plain text file example2_stack.php Example Example with not ready html
Plain text file Readme.txt Doc. How to use
Plain text file spl.php Aux. Spl

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:421
This week:0
All time:6,388
This week:455Up