Template::Plugin::String::Truncate - String::Truncate functions for Template Toolkit
version 0.02
[% USE st = String.Truncate %] This string is elided: [% st.elide('LONG ASS STRING, SON!', 18); %] This one is truncated: [% st.trunc('DAMN YOU GOT LONG STRINGS!', 10); %] And other stuff can happen too: [% st.elide('SHORT STRING', 5, { truncate => 'left' }) %]
This plugin allows you to use functions from String::Truncate in your templates. It is very simple and hopefully requires little explanation.
Truncates a string and marks the elision. See elide in String::Truncate.
elide
Truncates a string. See trunc in String::Truncate.
trunc
Cory G Watson <gphat@cpan.org>
This software is copyright (c) 2011 by Cold Hard Code, LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Template::Plugin::String::Truncate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Plugin::String::Truncate
CPAN shell
perl -MCPAN -e shell install Template::Plugin::String::Truncate
For more information on module installation, please visit the detailed CPAN module installation guide.