The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Valiant::Filter::Template - Flatten a Hashref into a string via a template pattern

SYNOPSIS

    package Local::Test;

    use Moo;
    use Valiant::Filters;

    has 'info' => (is=>'ro', required=>1);

    filters 'info',
      template => 'Hello {{name}}, you are {{age}} years old!';

    my $object = Local::Test->new(
      info => +{
        name => 'John',
        age => '52',
      }
    );

    $object->info;  # Hello John you are 52 years old!'
  

DESCRIPTION

Given a hashref value, using a template create a string. This isn't a very sophisticated templating system, and it won't throw errors if hash keys are missing.

ATTRIBUTES

This filter defines the following attributes

template

The template string

SEE ALSO

Valiant, Valiant::Filter, Valiant::Validator::Filter.

AUTHOR

See Valiant

COPYRIGHT & LICENSE

See Valiant