michaelhall / html-validator-plugin
This package is abandoned and no longer maintained.
No replacement package was suggested.
BlueMvc plugin for HTML validation
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
HTML validator plugin for the BlueMvc PHP framework.
Requirements
- PHP >= 7.1
Install with Composer
$ composer require michaelhall/html-validator-plugin
Basic usage
Once installed, this plugin validates every HTML output via the validator.w3.org API and replaces the result with an error message if validation failed.
Validation results are cached for identical content.
$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);
License
MIT