Recommend this page to a friend! |
Download .zip |
Info | View files (24) | Download .zip | Reputation | Support forum (1) | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2014-02-07 (2 years ago) | Not yet rated by the users | Total: 413 | All time: 6,124 This week: 874 |
Version | License | PHP version | Categories | |||
domfss 1.0 | Public Domain | 5.3 | HTML, PHP 5 |
Description | Author | |||||||||||||
This package can manipulate HTML documents using CSS selectors. |
|
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 |
File | Role | Description | ||
---|---|---|---|---|
CssSelector (6 files, 2 directories) | ||||
DOM (2 files) | ||||
coding_sample.jpg | Screen | sample of codes | ||
Example1.jpg | Screen | Screenshot from before and after effects of this class on example1 | ||
example1.php | Example | Example with ready html | ||
example2_stack.php | Example | Example with not ready html | ||
Readme.txt | Doc. | How to use | ||
spl.php | Aux. | Spl |
Files | / | CssSelector |
File | Role | Description | ||
---|---|---|---|---|
Exception (1 file) | ||||
Node (9 files) | ||||
CssSelector.php | Class | CssSelector | ||
Token.php | Class | Token | ||
Tokenizer.php | Class | Tokenizer | ||
TokenStream.php | Class | TokenStream | ||
XPathExpr.php | Class | XPathExpr | ||
XPathExprOr.php | Class | XPathExprOr |
Files | / | CssSelector | / | Node |
File | Role | Description |
---|---|---|
AttribNode.php | Class | AttribNode |
ClassNode.php | Appl. | ClassNode |
CombinedSelectorNode.php | Appl. | CombinedSelectorNode |
ElementNode.php | Appl. | ElementNode |
FunctionNode.php | Appl. | FunctionNode |
HashNode.php | Appl. | HashNode |
NodeInterface.php | Appl. | NodeInterface |
OrNode.php | Appl. | OrNode |
PseudoNode.php | Appl. | PseudoNode |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.