[Catalyst] templates

John Napiorkowski jjn1056 at yahoo.com
Wed Dec 20 19:40:12 GMT 2006


--- Octavian Rasnita <orasnita at gmail.com> wrote:

> Hi,
> 
> Could you please tell me why the templates should be
> put under the /root 
> directory?

Well, the only good reason I can think of is that
since it's the default all other Catalyst developers
will look for them there first.  Otherwise I know the
whole directory structure best practices thing is an
ongoing debate.  I don't think we've really figured it
out yet :)  Personally I don't like /root either but
just grew used to it.

> 
> Wouldn't be more appropriate to have a "templates"
> directory on the same 
> directory where /root is?

You can do that if you want; I can't judge what is
more appropriate.

> 
> Can I create a separate directory with templates
> which are not under /root 
> (for not allowing accessing the templates from the
> web)?

Sure, you can create a directory called /templates at
the same level as root, and if you are using template
toolkit for your view you can set the search path to
find your new directory.  Here's what I did (assuming
you have a TT view called TT.pm) in my myapp.yml file.

'View::TT':
  INCLUDE_PATH:
    - __path_to(templates)__

You might need to check the docs, I grabbed this from
a project I played with almost a year ago when I
started with Catalyst.

Although you can also configure static simple or
apache to not serve your template extensions, if you'd
rather keep it all in root.

static:
  no_logs: 0 #I like to see logs
  ignore_extensions:
    - tmpl
    - tt
    - tt2 # or whatever extension you use

> 
> Thanks.
> Octavian
> 
> 
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo:
> http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
>
http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Catalyst mailing list