felipe1234-dev/php-dom-query 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

felipe1234-dev/php-dom-query

Composer 安装命令:

composer require felipe1234-dev/php-dom-query

包简介

Easy-to-learn php dom parser with CSS selector and short codes

README 文档

README

Easy-to-learn php dom parser with CSS selector, short codes and ability to manipulate text nodes

GitHub issues GitHub forks GitHub stars GitHub license

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.

Installation

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-like PHP DOM vs jQuery comparison

Wrapping elements

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();
?>
Appending html

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();
Changing first <a> href

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.

Release History

  • v1.0
    • CHANGE: Initial release ready to be used

Meta

Felipe Alves – felipejean2002@gmail.com

Distributed under the MIT license. See LICENSE for more information.

https://github.com/felipe1234-dev/github-link

Contributing

  1. Fork it (https://github.com/felipe1234-dev/jquery-like-php-dom/fork)
  2. Create your feature branch (git checkout -b feature/jquery-like-php-dom)
  3. Commit your changes (git commit -am 'Add some description')
  4. Push to the branch (git push origin feature/jquery-like-php-dom)
  5. Create a new Pull Request

统计信息

  • 总下载量: 23
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固