MichaelHall / html-validator-plugin
此包已被弃用且不再维护。未建议替代包。
HTML验证的BlueMvc插件
v2.1.0
2019-01-30 18:45 UTC
Requires
- php: >=7.1
- ext-json: *
- bluemvc/bluemvc-core: ^2.0
- datatypes/datatypes: ^1.2||^2.0
- michaelhall/http-client: ^1.0
Requires (Dev)
- bluemvc/bluemvc-fakes: ^2.0
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2021-08-30 18:18:05 UTC
README
为BlueMvc PHP框架提供的HTML验证插件。
要求
- PHP >= 7.1
使用Composer安装
$ composer require michaelhall/html-validator-plugin
基本用法
安装后,此插件将通过validator.w3.org API验证每个HTML输出,如果验证失败,则将结果替换为错误消息。
为相同内容缓存验证结果。
$htmlValidatorPlugin = new \MichaelHall\HtmlValidatorPlugin\HtmlValidatorPlugin(); // Do not validate anything under /ajax/ $htmlValidatorPlugin->addIgnorePath('/ajax/'); // ...or the path /foo/bar $htmlValidatorPlugin->addIgnorePath('/foo/bar'); // By default, the plugin only runs in debug mode. // To enable in release mode. (Not recommended) $htmlValidatorPlugin->enableInReleaseMode(); // Add to application. $application->addPlugin($htmlValidatorPlugin);
许可证
MIT