Re: [Templates] TT and PHP

[prev] [thread] [next] [Date index for 2005/02/24]

From: Hans Juergen von Lengerke
Subject: Re: [Templates] TT and PHP
Date: 17:08 on 24 Feb 2005
Hello,

> From: Octavian Rasnita <orasnita@xxx.xx>
> 
> Ok, in TT you can work using other's templating systems
> styles, including "PHP style".

This won't help because it only changes the style of TAGs,
but not the syntax of the templating mini language, unless 
I'm missing something.

> From: "Denis Banovic" <denis.banovic@xxx.xx>
> 
> The problem is, I need it to work in PERL and in PHP! And
> it would be great if I could use the my TT-Syntax

One way would be to write a transformation tool that munges
your TT templates into Smarty Templates. But this will not
be an easy task and you have to be aware that Smarty is
nowhere near as feature rich as TT so you'd have to limit
the features you are using in TT.

However, I think that you probably do not necessarily need
all of your templates available in both languages, only a
small subset of them, for example WRAPPERs. In these files
you might be able to simply use both templating languages
and strip the unwanted out in a preprocessor of each
template run. For example

   Hello [% $customer.name %]<+ $customer->name +>!

(Tip: for Smarty, use different TAGs than Smarty's default
tags {..} because they always conflict with JS, I'm using
<+..+> in this example)

Now when you use the template with TT you strip out all
<+..+> before processing and likewise, if you use Smarty
strip out the TT tags.

Good luck,
Hans

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

(message missing)

AW: [Templates] TT and PHP
Denis Banovic 14:36 on 24 Feb 2005

Re: [Templates] TT and PHP
Octavian Rasnita 15:32 on 24 Feb 2005

Re: [Templates] TT and PHP
Hans Juergen von Lengerke 17:08 on 24 Feb 2005

AW: [Templates] TT and PHP
Denis Banovic 17:04 on 24 Feb 2005

Re: [Templates] TT and PHP
Steve Peters 17:37 on 24 Feb 2005

AW: [Templates] TT and PHP
Denis Banovic 10:07 on 25 Feb 2005

Re: AW: [Templates] TT and PHP
Simon Wilcox 10:28 on 25 Feb 2005

Re: [Templates] TT and PHP
Andy Wardley 19:35 on 25 Feb 2005

AW: [Templates] TT and PHP
Denis Banovic 14:53 on 25 Feb 2005

Re: AW: [Templates] TT and PHP
Michael Peters 15:02 on 25 Feb 2005

AW: [Templates] TT and PHP
Denis Banovic 12:15 on 27 Feb 2005

AW: [Templates] TT and PHP
Denis Banovic 12:34 on 27 Feb 2005

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52