views:

135

answers:

4

do Smarty and PHP go hand in hand.....and are these not two separate things...please tell me whats the main concept behind the separation of the application (the codings) and the presentation (the looks which includes the HTML tags) parts in Smarty

A: 

Smarty is designed so that designers without PHP knowledge could easily learn it and create the UI. It's designed to be much cleaner than PHP and have a simpler learning curve.

Gergely Orosz
However, I think they added too many features and it is now just as complex as PHP.
rikh
+1  A: 

Smarty and PHP go hand in hand in the sense that Smarty is a template engine for PHP - you will need to have PHP installed before you can use Smarty. With Smarty you can keep the HTML separate from the PHP. This is good for multiple purposes, such as not having to touch the .php files when you only need to edit the layout of a page.

Kaivosukeltaja
so is that it for the people to use smarty that they juz wanna keep the two things separate..and nothing else...
Sachindra
Smarty also does some performance tweaks like caching but yes, that's the main point of using it. To my knowledge there's nothing you can do in Smarty that can't be accomplished using straight PHP.
Kaivosukeltaja
A: 

Smarty is looking pretty dated at this point... as in most of those in the PHP community are stuck with it as a legacy app as opposed to starting to use it now. It was an excellent option 4-5+ years ago - the last time I used it regularly was 2006/7 - but at this point the alternative syntax is just a pain.

If you can't use straight PHP, you might check out Savant.

CaseySoftware
A: 

A good thing to consider instead of smarty is

echo "";

:)

Plus most frameworks have a layout/display system that is very similar to templating but without the unnecessary bloat.

Citizen