Pogledajte određenu poruku
Staro 17. 08. 2010.   #1
bluesman
Goran Pilipović
Sir Write-a-Lot
 
Avatar bluesman
 
Datum učlanjenja: 18.05.2005
Lokacija: Beograd
Poruke: 5.450
Hvala: 288
1.247 "Hvala" u 446 poruka
bluesman je osoba koju treba slušatibluesman je osoba koju treba slušatibluesman je osoba koju treba slušatibluesman je osoba koju treba slušatibluesman je osoba koju treba slušatibluesman je osoba koju treba slušatibluesman je osoba koju treba slušatibluesman je osoba koju treba slušatibluesman je osoba koju treba slušati
Pošaljite ICQ poruku za bluesman
Default Monte Ohrt - is PHP template language?

Upravo sam dobio jedan mail od Monte Ohrt, čoveka koji je napravio Smarty, gde komentariše "večitu dilemu" da li je PHP template language. Pročitajte šta kaže, ja mogu samo da se složim:

Citat:
Over the years this argument about PHP being a template language always crops up. In the beginning, Rasmus wrote PHP touted as an HTML-embedded scripting language. So you can say it is a template language, only for the lack of a better alternative to mixing PHP with HTML. That is, unless you use something like Smarty to create that separation. That is exactly why Smarty was created, because PHP, as a template language, just plain sucks. It is however, an excellent development language, so use it that way! I was fighting this clear back in the late 1990's. Developers constantly scoffed "IT *IS* A TEMPLATE LANGUAGE!", but I simply couldn't come to those terms, and eventually Smarty was released.

Another pretty cool thing (since I have been writing the new website for Smarty 3), template inheritance just plain rocks. You'll never go back to including headers, footers, etc. We've been doing {include} style management in templates for years, because, well, that's how you do it in PHP, and that's what we knew. That is how you *have* to do it in PHP! Smarty already makes a separation from PHP, so it was pretty straight-forward to implement inheritance. Give it a try.

So, although PHP *can* be used for templating, IMHO it's not a desirable way to use it. Python is also a horrible "template language", which is why Django Templates and CheetahTemplates were written. Same concept.

Of course you all have already come to the same conclusions, being here and reading this, right?

Is PHP a template language? It is as much as a template language as a chainsaw is a bread knife.
__________________
Goran Pilipović a.k.a. Ugly Fingers Bradley f.k.a. bluesman
I don't always know what I'm talking about but I know I'm right!
bluesman je offline   Odgovorite uz citat
4 članova zahvaljuje bluesman za poruku: