ahfeel/php-query

phpQuery 包的 composer 封装器

2.0 2018-04-19 11:48 UTC

This package is auto-updated.

Last update: 2024-09-22 08:58:05 UTC


README


composer require 'somesh/php-query'

或者在 composer.json 中添加 'somesh/php-query' 作为依赖

我添加了 composer.json 并自动加载了 php 文件,这样就可以直接使用 composer 进行设置。这不需要使用 psr-0 自动加载

使用 phpQuery

 $doc = phpQuery::newDocumentHTML($markup); 
 $doc = phpQuery::newDocumentXML();
 $doc = phpQuery::newDocumentFileXHTML('test.html'); 
 $doc = phpQuery::newDocumentFilePHP('test.php'); 
 $doc = phpQuery::newDocument('test.xml', 'application/rss+xml'); 
 $doc = phpQuery::newDocument('<div/>');
//Manipulating
$doc['ul > li'] ->addClass('my-new-class') 
//For more information about usage, visit the code.google.com/p/phpquery pahe

描述来自 https://github.com/punkave/phpQuery

这是 phpQuery,jQuery 选择器的 PHP 版本,对于 DOM 遍历和功能测试非常有用。

最初由 Tobiasz Cudnik:

http://code.google.com/p/phpquery/

并发布在 MIT 许可下。

我们将其克隆到 github,因为过去两年内没有在上游修复任何问题,我们需要修复与 serialize() 方法相关的一个错误,以便我们的功能测试能够工作。您可以在以下位置找到我们的 github 仓库

https://github.com/punkave/phpQuery

"你修复了什么?"

我们的初始提交包括对 serialize() 方法的修复,这对于表单提交至关重要(对功能测试来说是个大问题)。请查看 github 中的提交历史记录以获取任何后续更改。

  • P'unk Avenue