[Catalyst] Static::Simple 0.04, now with include_path

Andy Grundman andy at hybridized.org
Mon Aug 22 18:09:11 CEST 2005


Version 0.04 of the Static::Simple plugin is out.  If you were using 
0.03, please upgrade as there were a few minor bugs.

On CPAN soon, or find it now at http://pause.perl.org/incoming

0.04 adds a new (experimental) include_path feature that works similar 
to TT's INCLUDE_PATH.  You can now specify multiple directories to be 
used as static file "roots".  So for example, you could overlay a 
customer-specific logo image using code similar to the following:

MyApp->config->{static}->{include_path} = [
   \&customer_static_dir,
   MyApp->config->{root}
];

sub customer_static_dir {
   my $c = shift;

   return [ $c->session->{customer_dir} ];
}

Now a request to /images/logo.jpg will try these 2 directories in order, 
returning the first file found:
/customer/dir/images/logo.jpg
/your/app/home/root/images/logo.jpg

-Andy



More information about the Catalyst mailing list