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

    Template::Sandbox 1.04_01

    Download button

    No screenshots available
    Downloads: 177  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Sam Graham | More programs
    Perl Artistic License / FREE
    February 27th, 2012, 07:50 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Template::Sandbox description

    Fast template engine sandboxed from your application

    Template::Sandbox is yet another templating module, designed primarily for use in a webserver environment but usable anywhere, providing a more secure "sandboxed" environment than most templating systems.

    The core design philosophy for Template::Sandbox is that the template logic should have no access outside the template beyond that which you choose to permit it, this is frequently known as sandboxing.

    Unlike many other template systems, available on CPAN or in other languages, Template::Sandbox doesn't give the template access to the global variables of your application or to the core functions of the language.

    This means that your template authors only have access to the data and functionality that your application developers choose to grant them, this encourages both to work with "published" interfaces between the two systems - your template authors can't reach into the application's internal-only data, and so your application developers can change that internal data without worrying that the templates will stop working or expose confidential information.

    Template::Sandbox also provides exceptional performance, ranking among the fastest of the fully-featured template engines that don't rely on embedding perl within the templates.

    Template::Sandbox also provides the usual gamut of behaviours and optional features: caching compiled templates, includes, flow control, embedded expressions, cascading template candidates, and useful debugging information in case of errors.

    Furthermore, Template::Sandbox is designed to be subclassable should you wish to customize or extend other of its features.

    SYNOPSIS

     use Template::Sandbox;

     my $template = Template::Sandbox- >new();
     $template- >set_template( '/path/to/my/templates/accounts.html' );
     $template- >add_var( customers = > $customers );
     $template- >add_var( transactions = > $transactions );
     $template- >add_vars( {
     session = > $session_info,
     user = > $user_info,
     } );
     print ${$template- >run()};

     my $template = Template::Sandbox- >new(
     template_root = > '/path/to/my/templates',
     template = > 'accounts.html',
     cache = > $cache,
     );
     $template- >add_vars( {
     transactions = > $transactions,
     customers = > $customers,
     session = > $session_info,
     user = > $user_info,
     } );
     print ${$template- >run()};

     Within /path/to/my/templates/accounts.html:

     
     Welcome back, .< /p >
     
     Welcome.< /p >
     
     Recent Transactions:< /p >
     
     Transaction ID< /th >
     Customer< /th >
     Date< /th >
     Description< /th >

     < : expr transaction.id : >< /td >
     < : expr customers[ transaction.customer ].name : >< /td >
     < : expr transaction.date : >< /td >
     < : expr transaction.description : >< /td >



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    template engine | templating module | Perl module | template | engine | Perl



    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