in reply to HTML::Template and Dreamweaver MX
which ought to be Dreamweaver friendly (you write in HTML::Template tags except you substitute < with [% and > with %]. If you do decide to go this route, it's a good idea to make use of template caching ;)use HTML::Template; my $t = HTML::Template->new( scalarref => \'[%!-- TMPL_VAR name="foobery" escape=html --%]', filter => sub { my $text_ref = shift; $$text_ref =~ s| \[\% (?:!--\s*)? # ( [Tt][Mm][Pp][Ll]_ [^\]]+? ) #$1 (?:--\s*)? \%\] |<$1>|xg; } ); $t->param(foobery => 'barbery>>'); die $t->output(); __END__ barbery>> at html.template.pl line 11.
update: whoops, added missing \/? to regex ... basically updated regex (it's pretty thorough now, although it won't catch NAME="foo%]berry" which is pretty bizzare thing to have.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: HTML::Template and Dreamweaver MX
by mkenney (Beadle) on Nov 21, 2003 at 02:52 UTC | |
| |
Re: Re: HTML::Template and Dreamweaver MX
by mkenney (Beadle) on Nov 21, 2003 at 05:36 UTC |