jquery like php dom
v1.0
Easy-to-learn php dom parser with CSS selector, short codes and ability to manipulate text nodes
Simple PHP Dom Query interface simplification over native PHP Dom Document, which tries to look like closely to jQuery to look friendly to front-end developers. In this library, most of the main functions in jQuery and jQuery-like PHP DOM look exactly like behavior and syntax. This library was done for training purposes.
Composer
composer require felipe1234-dev/php-dom-query
Git
git clone git://git.code.sf.net/p/jquery-like-php-dom/repository jquery-like-php-dom
jQuery
<script>
$(document).ready(function(){
$("img").wrap("<figure></figure>");
});
</script>jQuery-like PHP DOM
<?php
include "path/webparser.php";
$doc = new WebParser();
$doc->loadHTMLFile($url);
$doc->Q("img")->wrap("<figure></figure>");
$doc->output();
?>jQuery
<script>
$(document).ready(function(){
$("ol").append("<li>Appended item</li>");
});
</script>jQuery-like PHP DOM
include "path/webparser.php";
$doc = new WebParser();
$doc->loadHTMLFile($url);
$doc->Q("ol")->append("<li>Appended item</li>");
$doc->output();jQuery
<script>
$(document).ready(function(){
$("a:first").href("folder/index.html");
});
</script>jQuery-like PHP DOM
include "path/webparser.php";
$doc = new WebParser();
$doc->loadHTMLFile($url);
$doc->Q("a:first")->href("folder/index.html");
$doc->output();For more examples and usage, please refer to the installation folder under manual.
Felipe Alves – [email protected]
Distributed under the MIT license. See LICENSE for more information.
https://github.com/felipe1234-dev/github-link
git checkout -b feature/jquery-like-php-dom)git commit -am 'Add some description')git push origin feature/jquery-like-php-dom)