galvao / gerdr
操作 DOM HTML 树
0.1.0-alpha
2019-10-02 14:44 UTC
Requires
- php: ^7.3
- league/climate: ^3.5
- monolog/monolog: 1.*
This package is auto-updated.
Last update: 2024-09-06 07:10:53 UTC
README
通过 PHP 的 DOM 扩展操作 DOM HTML 树。
安装
composer require galvao/gerdr
用法
- 作为应用程序
/path/to/gerdr/bin/gerdr -c /path/to/config.json -d /path/to/dom.html
作为应用程序,Gerdr 输出修改后的 DOM HTML,以便可以通过管道、转发等操作传递到任何 bash 应用程序。
- 在您的项目中
try { $gerdr = new Gerdr($dom, $config); } catch (\Exception $e) { // Treat the exception } try { $gerdr->process(); } catch (\Exception $e) { // Treat the exception } $result = $gerdr->getModifiedDom();
依赖项
操作
目前 Gerdr 只支持使用 remove
操作删除元素/属性。
致谢
- Gerdr 的标志包含来自 "Skírnir and Gerðr I" 的片段,作者为 Lorenz Frølich;
- 标志中使用的字体为 "Norse",作者为 Joël Carrouché。