Re: [Templates] TT and PHP
[prev]
[thread]
[next]
[Date index for 2005/02/24]
Hi Denis,
Essentially, then, you are looking to convert TT to PHP. My guess is tha=
t
it can't be done with a simple regexp since the various tags do not=20
do a full one-to-one match from TT to PHP. =20
Have you tried looking into a MVC type solution where you could easily us=
e
TT and PHP as separate parts of an overall application?
Steve Peters
steve@xxxxxxxxxxx.xxx
On Thu, Feb 24, 2005 at 06:04:52PM +0100, Denis Banovic wrote:
> Hi Teddy,
>=20
> I know that in TT you can change the TAG-Styles from [% %] to anything =
you want, but the Syntax is still a bit different in PHP and TT.
>=20
> What I'm searching for, is a regex or module, that would convert "[% IF=
ELSIF ELSE END %]" and
> [% FOREACH END %] statement to PHP, that's all.
>=20
> I just wanted to know, if someone has already done this before?
>=20
> Thanks
>=20
> Denis
>=20
>=20
> -----Urspr=FCngliche Nachricht-----
> Von: Octavian Rasnita [mailto:orasnita@xxx.xx]=20
> Gesendet: Donnerstag, 24. Februar 2005 16:33
> An: Denis Banovic
> Cc: templates@xxxxxxxxxxxxxxxx.xxx
> Betreff: Re: [Templates] TT and PHP
>=20
>=20
> Ok, in TT you can work using other's templating systems styles, includi=
ng
> "PHP style".
>=20
> You can find more information in the TT manual.
>=20
> Teddy
>=20
> Teddy
>=20
> ----- Original Message -----=20
> From: "Denis Banovic" <denis.banovic@xxx.xx>
> To: "Octavian Rasnita" <orasnita@xxx.xx>
> Cc: <templates@xxxxxxxxxxxxxxxx.xxx>
> Sent: joi, 24 februarie 2005 16:36 PM
> Subject: AW: [Templates] TT and PHP
>=20
>=20
> Hi!
>=20
> The problem is, I need it to work in PERL and in PHP! And it would be g=
reat
> if I could use the my TT-Syntax
>=20
> Thanks
>=20
> Denis
>=20
> -----Urspr=FCngliche Nachricht-----
> Von: Octavian Rasnita [mailto:orasnita@xxx.xx]
> Gesendet: Donnerstag, 24. Februar 2005 14:42
> An: Denis Banovic
> Betreff: Re: [Templates] TT and PHP
>=20
>=20
> Hi,
>=20
> You should use Smarty templating system with PHP.
>=20
> Teddy
>=20
> ----- Original Message -----=20
> From: "Denis Banovic" <denis.banovic@xxx.xx>
> To: <templates@xxxxxxxxxxxxxxxx.xxx>
> Sent: Thursday, February 24, 2005 3:26 PM
> Subject: [Templates] TT and PHP
>=20
>=20
> Hi!
>=20
> I was just wondering if anyone already tried to interpret TT-Templates =
in
> PHP?
>=20
> My problem is, that I have webspaces where we are using both, perl and =
php
> tools, and the tools are using the same
> Header/Footer files.
>=20
> This works great as long as the Header/Footer are static files. But whe=
n our
> designers / customers want to put some dynamic content into the
> Header/Footer, I have a problem.
>=20
> I've wrote some regexes that work well, when I just need to insert some=
file
> or variable content:
>=20
> E.g this works well for [% INCLUDE myfile.htm %]
>=20
> preg_match_all("/\[\%\s*INCLUDE\s*\"(.*?)\"\s*\%\]/", $cc, $matches);
> foreach ($matches[1] as $file) {
> $cont =3D $this->load_file($file);
> $cc =3D preg_replace("/\[\%\s*INCLUDE\s*\"$file\"\s*\%\]/", $cont, $cc)=
;
> }
>=20
>=20
> But it would be great to have a support for a normal "IF ELSIF ELSE END=
" and
> FOREACH statement.
>=20
> Has anyone done already something like this? Or is there a module that =
can
> process that?
>=20
> Thanks
>=20
> Denis
>=20
> "THINK THE WEB WAY."
> ---------------------------------------------------
> NCM - NET COMMUNICATION MANAGEMENT GmbH
> ---[ Denis Banovic - CTO
> mailto:denis.banovic@xxx.xx
> ---[ M=FChlstrasse 4a
> AT - 5023 Salzburg
> Tel. 0662 / 644 688
> ---[ Fax: 0662 / 644 688 - 88
> http://www.ncm.at
> ---------------------------------------------------
>=20
>=20
>=20
>=20
>=20
> ____________
> Virus checked by G DATA AntiVirusKit
> Version: AVK 15.0.2702 from 26.01.2005
> Virus news: www.antiviruslab.com
>=20
>=20
> _______________________________________________
> templates mailing list
> templates@xxxxxxxxxxxxxxxx.xxx
> http://lists.template-toolkit.org/mailman/listinfo/templates
>=20
>=20
> ____________
> Virus checked by G DATA AntiVirusKit
> Version: AVK 15.0.2702 from 26.01.2005
> Virus news: www.antiviruslab.com
>=20
>=20
> ____________
> Virus checked by G DATA AntiVirusKit
> Version: AVK 15.0.2702 from 26.01.2005
> Virus news: www.antiviruslab.com
>=20
>=20
> _______________________________________________
> templates mailing list
> templates@xxxxxxxxxxxxxxxx.xxx
> http://lists.template-toolkit.org/mailman/listinfo/templates
>=20
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
(message missing)
|