Ein einfach zu lernender PHP-DOM-Parser mit CSS-Selektor, Kurzcodes und Fähigkeit zur Manipulation von Textknoten
Einfache PHP-DOM-Abfrage-Schnittstelle Einfachung im nativen PHP-DOM-Dokument, das versucht, dem JQuery genau wie Front-End-Entwicklern freundlich auszusehen. In dieser Bibliothek sehen die meisten Hauptfunktionen in JQuery und JQuery-ähnlichem PHP-DOM genau wie Verhalten und Syntax aus. Diese Bibliothek wurde zu Schulungszwecken durchgeführt.
Komponist
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-ähnliches 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-ähnliches 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-ähnliches PHP DOM
include " path/webparser.php " ;
$ doc = new WebParser ();
$ doc -> loadHTMLFile ( $ url );
$ doc -> Q ( " a:first " )-> href ( " folder/index.html " );
$ doc -> output (); Weitere Beispiele und Verwendung finden Sie im Installationsordner unter manual .
Felipe Alves - [email protected]
Unter der MIT -Lizenz verteilt. Weitere Informationen finden Sie LICENSE .
https://github.com/felipe1234-tev/github-link
git checkout -b feature/jquery-like-php-dom )git commit -am 'Add some description' )git push origin feature/jquery-like-php-dom )