[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] proposal to enhance load_tmpl() with default template name.


On 8/24/05, Jason Purdy <suppressed> wrote:
> Also, while you're looking at load_tmpl(), can you also modify it to
> support loading non-files (filehandles or scalars w/ the content already
> in there)?  For the filehandle scenario, you could just check the
> parameter.  For the scalars w/ template content in them, that might take
> another method name ... like $self->set_tmpl( $template_source, ... );

The standard idiom for passing either a filename or the contents of a
file is to pass the contents as a reference to a string, and the
filename as a plain string.

$self->load_tmpl(\'<html>...</html>');
$self->load_tmpl('filename.tmpl');

This ends up being backwards compatible as well.

Cheers,

Cees

---------------------------------------------------------------------
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.