PHP vs. Python/comp.lang.php?

Kragen Sitaker kragen at pobox.com
Sat Dec 1 13:41:32 EST 2001


ssthapa at classes.cs.uchicago.edu (Suchandra Thapa) writes:

> Kragen Sitaker <kragen at pobox.com> wrote:
> >"%s" % foo in Python is a templating feature.  In PHP the whole
> >language is a templating feature.  What am I missing?
> 
>     By templating features, I was refering to a way to separate the html
> and code into separate files, one for the html with tags indicating where
> to substitute values and one for the code.  This is primarily so that
> the web designers/graphic artists can fiddle around with the look and feel
> without having to know php or python.  Likewise, the developers can write
> the code without having to worry about the appearance.

Doesn't PHP let you call routines defined in another file?  That sounds
to me like exactly what you're asking for. And Python certainly lets
you %-interpolate into strings read from another file.

Of course, neither of these really answer when you have blocks of HTML
that repeat under programmatic control, unless they're in a third
file; but I can't think of a reasonable solution to that.




More information about the Python-list mailing list