Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Perl Modules

    Text::Xslate 1.5007

    Download button

    No screenshots available
    Downloads: 83  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Goro Fuji | More programs
    Perl Artistic License / FREE
    December 11th, 2011, 21:50 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Text::Xslate description

    Scalable template engine for Perl5

    Text::Xslate is a template engine, tuned for persistent applications, safe as an HTML generator, and with rich features.

    There are a lot of template engines in CPAN, for example Template-Toolkit, Text::MicroTemplate, HTML::Template, and so on, but all of them have demerits at some points. This is why Xslate is developed and now it is well-honed as the standard template engine for web applications.

    The concept of Xslate is strongly influenced by Text::MicroTemplate and Template-Toolkit 2, but the central philosophy of Xslate is different from them. That is, the philosophy is sandboxing that the template logic should not have no access outside the template beyond your permission.

    SYNOPSIS

     use Text::Xslate qw(mark_raw);

     my $tx = Text::Xslate->new();

     my %vars = (
     title => 'A list of books',
     books => [
     { title => 'Islands in the stream' },
     { title => 'Programming Perl' },
     # ...
     ],

     # mark HTML components as raw not to escape its HTML tags
     gadget => mark_raw('< div class="gadget" >...< /div >'),
     );

     # for files
     print $tx->render('hello.tx', \%vars);

     # for strings
     my $template = q{
     < h1 >< : $title : >< /h1 >
     
     : for $books -> $book {
     < li >< : $book.title : >< /li >
     : } # for
     < /ul >
     };

     print $tx->render_string($template, \%vars);



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    template engine | HTML generator | Perl module | Perl | template | engine



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM