|
|
Choosing A Webhost: |
proposal to enhance load_tmpl() with default template name.: msg#00104lang.perl.modules.cgi-appplication
Hello, Here's a proposal to enhance a load_tmpl() a bit more. Now that we have CGI::Application::Forward, we can reliably get the current run mode if we want to. I propose the load_tmpl() default trying $runmode.'.html' as the template name, if no file name is provided. I believe this is backwards compatible because currently an undefined value would get passed to HTML::Template, which would die in this case. This means for common cases you can just do: my $t = $self->load_tmpl; $t->param(\%params); return $t->output; And the project may be easier to navigate because of the added consistency between run mode names and file names. Of course, using the ::AnyTemplate plugin, this could be even briefer if you want: return $self->template->fill(\%params); While I think power users will gravitate towards using the ::TT or ::AnyTemplate plugins, I think some will prefer having this simple feature in the core, without having to learn or use additional middleware to talk to a templating system. Thoughts? Mark -- . . . . . . . . . . . . . . . . . . . . . . . . . . . Mark Stosberg Principal Developer mark-WmyhgDpj2fCHT8/ATrE1yw@xxxxxxxxxxxxxxxx Summersault, LLC 765-939-9301 ext 202 database driven websites . . . . . http://www.summersault.com/ . . . . . . . . --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp-svx1JCNWaqPWzzAP45jFb16hYfS7NtTn@xxxxxxxxxxxxxxxx/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: cgiapp-unsubscribe-svx1JCNWaqPWzzAP45jFb16hYfS7NtTn@xxxxxxxxxxxxxxxx For additional commands, e-mail: cgiapp-help-svx1JCNWaqPWzzAP45jFb16hYfS7NtTn@xxxxxxxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: RFC: Sub applications, CGI and mod_perl issues, Roberto Ruiz |
|---|---|
| Next by Date: | Re: proposal to enhance load_tmpl() with default template name., Jason Purdy |
| Previous by Thread: | Fwd: [rest-discuss] [ANN] Two Tutorials on REST - a quick intro and an expanded version, Timothy Appnel |
| Next by Thread: | Re: proposal to enhance load_tmpl() with default template name., Jason Purdy |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |