logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Text::Xslate::Bridge - The interface base class to import methods

Description

       This module is the base class for adaptor classes.

Interface

"__PACKAGE__->bridge(@mapping):Void"
       Install a bridge module that has method @mapping.  See "example/bridge.pl" for more an example.

Name

       Text::Xslate::Bridge - The interface base class to import methods

See Also

       Text::Xslate

       Text::Xslate::Bridge::TT2

       Text::Xslate::Bridge::TT2Like

       Text::Xslate::Bridge::Alloy

perl v5.40.0                                       2024-10-20                          Text::Xslate::Bridge(3pm)

Synopsis

           package SomeTemplate::Bridge::Xslate;

           use parent qw(Text::Xslate::Bridge);

           __PACKAGE__->bridge(
               nil    => \%nil_methods,
               scalar => \%scalar_methods,
               array  => \%array_methods,
               hash   => \%hash_methods,

               function => \%functions,
           );

           # in your script

           use Text::Xslate;

           my $tx = Text::Xslate->new(
               module => [
                   'SomeTemplate::Bridge::Xslate'
                       => [-exclude => [qw(hash::keys hash::values)]],
               ],
           );

See Also