Template::Plugin::StashValidate - MooseX::Params::Validate for template stash values
Allows a template to validate specific hash keys via MooseX::Params::Validate
[% USE StashValidate { 'advice_discrepant' => { 'isa' => 'ArrayRef | HashRef', 'optional' => 1 }, } %]
Allows a template to validate keys from the stash (Template::Stash) using MooseX::Params::Validate. Accepts a hashref as the sole argument, and this is the parameter_spec that's passed straight through to MooseX::Params::Validate's validated_hash. We only validate elements in the stash for which you've specified an allowed value - other keys in the stash are ignored.
parameter_spec
validated_hash
In short, for options, see: MooseX::Params::Validate.
MooseX::Params::Validate supports both coerced values and default values - this means the value you put in might not be the value you get out again. This module supports that - the stash is updated with any changes returned.
This is the method called when you say [% USE StashValidate {} %], as per the documentation in Template::Plugin.
[% USE StashValidate {} %]
Peter Sergeant - pete@clueball.com, while working for Net-A-Porter.
pete@clueball.com
To install Template::Plugin::StashValidate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Plugin::StashValidate
CPAN shell
perl -MCPAN -e shell install Template::Plugin::StashValidate
For more information on module installation, please visit the detailed CPAN module installation guide.