View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Zoffix Znet > App-ZofCMS > App::ZofCMS::Plugin::Debug::Validator::HTML



Annotate this POD


View/Report Bugs
Module Version: 1.001007   Source  


App::ZofCMS::Plugin::Debug::Validator::HTML - debugging plugin for auto validating HTML


In your Main Config file or ZofCMS Template:

    plugins => [ 'Debug::Validator::HTML' ]

In your HTML::Template template:

    <tmpl_var name="plug_val_html">

Access your page with

Read the validation results \o/


The module is a debugging plugin for App::ZofCMS that provides means to validate the HTML code that you are writing on the spot.

This documentation assumes you've read App::ZofCMS, App::ZofCMS::Config and App::ZofCMS::Template



    plugins => [ qw/Debug::Validator::HTML/ ],

You need to include the plugin in the list of plugins to be executed.


    # everything is optional
    plug_validator_html => {
        t_name          => 'plug_val_html',
        q_name          => 'plug_val_html',
        validator_uri   => '',
        address         => '',

The plugin takes its optional configuration from plug_validator_html first-level key that takes a hashref as a value. Plugin will still run even if plug_validator_html key is not present. You can set any of the config options in either Main Config File or ZofCMS Template file. Whatever you set in ZofCMS Template file will override the same key if it was set in Main Config File. Possible keys/values are as follows:


    t_name => 'plug_val_html',

Optional. The plugin sets validation results in one of the keys in the {t} special key. The t_name argument specifies the name of that key. See HTML::Template VARIABLES section below for details. Defaults to: plug_val_html


    q_name => 'plug_val_html',

Optional. To trigger the execution of the plugin you need to pass a query parameter that is set to a true value. This is to speed up normal development process (because you don't really want to validate on every refresh) but most importantly it is to prevent infinite loops where the plugin will try to execute itself while fetching your HTML for validation. See SYNOPSIS section for example on how to trigger the validator with this query parameter. Defaults to: plug_val_html


    validator_uri   => '',

Optional. Plugin accesses a W3C markup validator. The validator_uri argument takes a URI pointing to the validator. It would be REALLY GREAT if you'd download the validator for your system and use a local version. Debian/Ubuntu users can do it as simple as sudo apt-get install w3c-markup-validator, others see If you cannot install a local version of the validator set validator_uri to Defaults to:


    address => '',

Optional. The plugin uses needs to fetch your page in order to get the markup to validate. Generally you don't need to touch address argument as the plugin will do its black magic to figure out, but in case it fails you can set it or wish to validate some other page that is not the one on which you are displaying the results, you can set the address argument that takes a string that is the URI to the page you wish to validate.


    <tmpl_var name='plug_val_html'>
    <tmpl_var name='plug_val_html_link'>

The plugin sets two HTML::Template variables in {t} key; its name is what you set in t_name argument, which defaults to plug_val_html.

If your HTML code is valid, this variable will be replaced with words HTML is valid. Otherwise you'll see either an error message for why validation failed or actual error messages that explain why your HTML is invalid.

The second variable will contain a link to either turn on or turn off validation. The name of that variable is contructed by appending _link to the t_name argument, thus by default it will be <tmpl_var name='plug_val_html_link'>


You'd probably would want to include the plugin to execute in your Main Config File and put the <tmpl_var name=""> in your base template while developing the site. Just don't forget to take it out when you done ;)

PLEASE! Install a local validator. Tons of people already accessing the one that is hosted in, don't make the lag worse.


Fork this module on GitHub:


To report bugs or request features, please use

If you can't access GitHub, you can email your request to bug-App-ZofCMS at


Zoffix Znet <zoffix at> (,


You can use and distribute this module under the same terms as Perl itself. See the LICENSE file included in this distribution for complete details.

syntax highlighting: