Halley, Edward D. wrote:
I've just started digging into CGI::Application and thinking about how to architect a small project of my own. Sorry if this is too basic, but Google didn't help me and this thread may help others. One question came to mind: I generally prefer to use one or two main .shtml files to give a site a basic layout, include all the style features. I then use Server Side Includes (SSI) to call on CGI scripts to build up portions of the page's content. I don't like making CGI scripts that output entire HTML pages. Also, though I know it's mostly irrational, I also don't like the ".cgi" appearing in a URL that people may end up cut-and-pasting to make links. At most, "http://foo/?bar=4" should clue the application if a parameter must be included in the URL. How compatible are these approaches? Can I make my CGI::App "run modes" implement only certain panes of an overall SHTML layout? If the pane wanted to provide a link to forward users to some other run mode, can I easily control the URL construction?
CGI::App is very flexible in this regard. In fact I've done something similar in the past, except instead of filling in the whole page, I've just had it fill in dynamic portions (like navigation based on login, etc) for static pages (generated by the krang CMS).
C::A will just return to the browser what you return from your run mode. The only exception is HTTP headers, but this can be turned off by setting $self->header_type('none').
Also, may I suggest you at least look at doing this another way. If the majority of you app is dynamic then I would either use the cgiapp_postrun() to wrap your run mode's content in a similar look and feel, or use something like the WRAPPER functionality of Template Toolkit. This will let you control it from a central location and avoid outside dependancies like SSI.
--
Michael Peters
Developer
Plus Three, LP
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.