[Templates] filtering includes

Rafiq Ismail (ADMIN) rafiq@joshua.dreamthought.com
Tue, 5 Nov 2002 13:14:20 +0000 (GMT)


On 5 Nov 2002, Simon Wilcox wrote:

> On Tue, 2002-11-05 at 12:10, Rafiq Ismail (ADMIN) wrote:
> > Hi Templatinos,
>
> You could use INSERT in your templates to read in the html. This would
> be faster than INCLUDE but only works if you have no TT directives in
> the files.
>
> To do the substitution I would use a FILTER on the assembled output.
> This is what I'm currently writing to handle the munging of img tags.

Thanks, muchly appreciated.

So, just for clarity:

I'll be using a ... FILTERS =>{ 'substitute' => [sub { s/$_[0]/$_[1]/g;},
1]} ... in my constructor, with:

[% FILTER substitute model.qr_left, model.qr_right %]
[% INSERT 'my/file' %]
[% END %]

should this do the trick?

Cheers,

Rafiq