[Catalyst] Directory layout
Thanks for the responses to my question about the View Directory. I'm still trying to figure out the reasons for the rest of the directory layout. The templates are not in the View directory, because the lib hierarchy is just for Perl code. Is that right? Is root kind of the equivalent of htdocs? What else would go in the static subdirectory besides images? Would you put css files in here? Does javascript go in static, or does it get a directory underneath root? Are any parts of the layout created by catalyst.pl changeable, or would it break Catalyst to rename them? If, for example, root was changed to htdocs, or you didn't use the static directory? Sorry for all the questions. I've been studying the documentation, but haven't had much like finding explanations for these things, and I'm not sure where to look in the code. Thanks, Gerda Shank ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Directory layout
On Nov 8, 2007, at 8:47 AM, Gerda Shank wrote: The templates are not in the View directory, because the lib hierarchy is just for Perl code. Is that right? Yes. The Model, Controller and View directories house the respective perl classes that handle those functions. Is root kind of the equivalent of htdocs? What else would go in the static subdirectory besides images? Would you put css files in here? Does javascript go in static, or does it get a directory underneath root? Before I say anything, let me say: The short answer is that you can set things up however you want. The 'static' directory is similar to htdocs. The TT view is configured by default to use the 'root' directory as it's path for templates. The static directory is a best practice, I usually put 'css', 'javascript' and 'images' in there. It's a good idea to put all your static files under a common directory when using mod_perl because then you can tell apache to use the default handler for all files under that path. Using mod_perl to serve images is Bad Mojo. It's probably also a good idea for a bunch of other reasons. Are any parts of the layout created by catalyst.pl changeable, or would it break Catalyst to rename them? If, for example, root was changed to htdocs, or you didn't use the static directory? You probably could to this, but the default layouts are sort of a best practice. I'd use the defaults until you understand them better. Sorry for all the questions. I've been studying the documentation, but haven't had much like finding explanations for these things, and I'm not sure where to look in the code. No worries. It's better than doing things wrong and then complaining. ;) -- Cory 'G Watson http://www.onemogin.com ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Directory layout
On 11/8/07, Gerda Shank [EMAIL PROTECTED] wrote: Thanks for the responses to my question about the View Directory. I'm still trying to figure out the reasons for the rest of the directory layout. The templates are not in the View directory, because the lib hierarchy is just for Perl code. Is that right? Is root kind of the equivalent of htdocs? What else would go in the static subdirectory besides images? Would you put css files in here? Does javascript go in static, or does it get a directory underneath root? Are any parts of the layout created by catalyst.pl changeable, or would it break Catalyst to rename them? If, for example, root was changed to htdocs, or you didn't use the static directory? Sorry for all the questions. I've been studying the documentation, but haven't had much like finding explanations for these things, and I'm not sure where to look in the code. Thanks, Gerda Shank I put all my static files under static. Usually I have a directory structure like this: root/static/ root/static/js root/static/css root/static/images -- Jonas ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Directory layout
On 9 Nov 2007, at 01:47, Gerda Shank wrote: Thanks for the responses to my question about the View Directory. I'm still trying to figure out the reasons for the rest of the directory layout. The templates are not in the View directory, because the lib hierarchy is just for Perl code. Is that right? Is root kind of the equivalent of htdocs? What else would go in the static subdirectory besides images? Would you put css files in here? Does javascript go in static, or does it get a directory underneath root? Are any parts of the layout created by catalyst.pl changeable, or would it break Catalyst to rename them? If, for example, root was changed to htdocs, or you didn't use the static directory? Sorry for all the questions. I've been studying the documentation, but haven't had much like finding explanations for these things, and I'm not sure where to look in the code. One slightly more exotic thing I've done is: in Controller::Root sub index : Private { my ($self, $c) = @_; $c-res-redirect('/static/ index.html');} sub ajax_method : Local { # do stuff for handling ajax calls from the static page above } So the answer is whatever you like :-) ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/