Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Smarty vs PHP Includes

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
phrax
Smarty n00b


Joined: 22 Apr 2003
Posts: 2

PostPosted: Tue Apr 22, 2003 8:50 pm    Post subject: Smarty vs PHP Includes Reply with quote

First off, I'm a big fan of Smarty! Smile
I prefer to use it to handle the display logic, and have PHP handle the application logic.

Rasmus did a presentation for our little php group (vancouver.php.net) last week. He mentioned that he doesn't know why people need a templating library for php. "PHP is a templating system".

A collegue at work also shares a similar opinion. I have a hard time trying to argue the advantages a templating engine provides over having HTML with straight PHP encoded into it.

What do you guys think?

I find that for larger projects, with a lot of application logic, Smarty really shines. For smaller products, using include() to bring in HTML (with embeded php) is fine.

When somebody says, "What is the point of smarty, if you can do it in PHP" what kind of answers do you guys give?

And where does PHP stop and Smarty begin? Cause won't people eventually start asking for for loops, while loops, etc. etc. ? Won't you be re-inventing PHP again?

Ben.
Back to top
View user's profile Send private message
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Tue Apr 22, 2003 9:50 pm    Post subject: Reply with quote

Though I have great respect for Rasmus I would have to disagree. PHP alone couldn't make templating as easy and extendable as Smarty has.
_________________
"Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane
Back to top
View user's profile Send private message Visit poster's website
joscha
Smarty Rookie


Joined: 18 Apr 2003
Posts: 8
Location: Metzingen, Germany

PostPosted: Tue Apr 22, 2003 10:29 pm    Post subject: Re: Smarty vs PHP Includes Reply with quote

phrax wrote:

When somebody says, "What is the point of smarty, if you can do it in PHP" what kind of answers do you guys give?


I normally ask them: ever had a graphic guy who begins trembling on hearing the words "include, foreach-loop, PHP Tag" in one sentence to work on your PHP files changing a vertical-rowed table to a horizontal-rowed table? No? So you are one of the lucky guys Very Happy

greets,
Joscha
Back to top
View user's profile Send private message Visit poster's website
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Tue Apr 22, 2003 11:04 pm    Post subject: Re: Smarty vs PHP Includes Reply with quote

joscha wrote:
I normally ask them: ever had a graphic guy who begins trembling on hearing the words "include, foreach-loop, PHP Tag" in one sentence to work on your PHP files changing a vertical-rowed table to a horizontal-rowed table? No? So you are one of the lucky guys Very Happy


Exactly my thought, you have a lot of people who are god gifted at graphics and web design but cant code worth shit. Those are the people you want doing your Smarty templates. Except for the occasional foreach or section bit but those are easy to understand and use.
_________________
"Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane
Back to top
View user's profile Send private message Visit poster's website
phrax
Smarty n00b


Joined: 22 Apr 2003
Posts: 2

PostPosted: Wed Apr 23, 2003 7:23 am    Post subject: .. Reply with quote

Good suggestions.
For Rasmus, working at Yahoo and all, they code a lot of their functionality in C/C++, so PHP would be their templating layer. For people like me who write all of my application logic in PHP, Smarty makes more sense.

Rasmus did give us insight into how incredibly inefficient include() and include_once(), require, require_once are. I wonder how fast smarty is vs PHP includes...

Ben.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP