[Catalyst] How Catalyst views files without extensions
Michael Higgins
linux at evolone.org
Fri Jan 4 00:31:01 GMT 2008
On Thu, 3 Jan 2008 15:19:35 -0800
"Emily Heureux" <emily at burnham.org> wrote:
> I am calling the applet from within test.tt2, and loading the file
> also from within test.tt2. I did some further reading, and it seems
> that what I need to do is designate a directory as static that
> contains the files (with no extensions). I found this code:
>
>
>
> MyApp->config->{static}->{dirs} = [
> 'static',
> qr/^(images|css)/,
> ];
>
My understanding is that this should return whatever gets captured by
the regular expression in the parens. In this case, any request for
anything in [cat_root]/images/ or [cat_root]/css/
I'm using Static to serve some JS (since I can't put it on a separate
location due to cross-site scripting issues..??) from the standalone
development server script like this:
__PACKAGE__->config->{static}->{dirs} = ['pdf_tmp','static','static/javascript'];
__PACKAGE__->config->{static}->{ignore_extensions} = [ qw/tt2 asp php/ ];
__PACKAGE__->config->{static}->{mime_types} = {
pdf => 'application/octet-stream',
};
... in my "MyApp".pm module (not a M, V, or C).
I don't know if this is the *best* way, but it works, for me, for now.
[ P.S. -- please don't top post. ]
HTH,
--
|\ /| | | ~ ~
| \/ | |---| `|` ?
| |ichael | |iggins \^ /
michael.higgins[at]evolone[dot]org
More information about the Catalyst
mailing list