The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Template::Lace::Utils - Utility Methods

SYNOPSIS

TBD

DESCRIPTION

A collection of helpful utility methods

mk_component

Make a callback component. See Template::Lace::ComponentCallback. Example:

use Template::Lace::Utils 'mk_component';
my $factory = Template::Lace::Factory->new(
  model_class=>'Local::Template::User',
  component_handlers=>+{
    tag => {
      anchor => mk_component {
        my ($self, %attrs) = @_;
        return "<a href='$_{href}' target='$_{target}'>$_{content}</a>";
      },
    },
  },
);

SEE ALSO

Template::Lace.

AUTHOR

Please See Template::Lace for authorship and contributor information.

COPYRIGHT & LICENSE

Please see Template::Lace for copyright and license information.