in reply to Re: 1001 CPAN Template modules
in thread 1001 CPAN Template modules

Bingo!

Of course one could think more about the API, but i love it already. It is really what i had in mind.

For maximum flexibility one could add shebang detection:
my $tpi = TPI->new( dsn => 'tpd:Mason:/my/files/' ); $tpi->register( 'TPD::HTML_Mason', shebang => '#!mason' ); $tpi->register( 'TPD::TT', shebang => '#!tt' ); $tpi->register( 'TPD::HTML_Template', shebang => '#!htmpl' ); $tpi->register( 'TPD::PETAL', shebang => '#!petal' ); $tpi->variables( author => 'a', title => 'b' ); print $tpi->interpolate( <<'END_HERE' ); #!mason Welcome <% $author %> END_HERE print $tpi->interpolate( <<'END_HERE' ); #!htmpl Welcome <TMPL_VAR author> END_HERE
Of course the TPD driver could translate ie. looop variables n'stuff.

I am convinced that ~90% demand nothing more than the basic functionality from the templating engine. And so one could unify all the tons of api to just TPI.


I am convinced this would be fastly adopted/standard as DBI.

Anybody setting up a ml?

Murat

Replies are listed 'Best First'.
•Re: Re: Re: 1001 CPAN Template modules
by merlyn (Sage) on Apr 22, 2004 at 14:39 UTC
    I think if you wait for TT3 (the heir apparent to TT2), you'll find that it does most of what you want. A core of abstraction of the parts of a templating engine, with skins that can be added to mimic most existing systems.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.