Template::Sandbox

Fast template engine sandboxed from your application
Download

Template::Sandbox Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Sam Graham
  • Publisher web site:
  • http://search.cpan.org/~sgraham/

Template::Sandbox Tags


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.name : >< /td > < : expr transaction.date : >< /td > < : expr transaction.description : >< /td > Requirements: · Perl


Template::Sandbox Related Software