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

This package is auto-updated.

Last update: 2021-08-30 18:18:05 UTC


README

Build Status AppVeyor codecov.io StyleCI License Latest Stable Version Total Downloads

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