PDA

View Full Version : Smarty Template Engine



Todd W
11-30-2005, 10:42 PM
Does anyone use the Smarty template engine by php.net ?

http://smarty.php.net/

It looks VERY powerful.

Chris
12-01-2005, 11:16 AM
I always thought it looked too complicated. Meaning it didn't simplify things enough, you're better off using a CMS (custom or not) or just nothing at all.

I suppose perhaps in a large single website project with multiple programmers and designers it might have it's place.

Todd W
12-01-2005, 01:03 PM
It looks like "CMS Made Simple" mentioned in the other post uses the smarty class...

I agree it does look very complex and for something simple Codewalker has a nice/simple Template system.

chromate
12-01-2005, 05:04 PM
The debate over smarty has been raging for ages. The real advantage of using a template engine such as this is in creating a layered application. Meaning the graphical design of a site is separate from the business logic, which is separate from the concerns of storing the data in a database.

This in theory means you can have designers working on how the application's interface looks without worrying about the code behind it. But in practice, the designers still need to know how to handle stuff like recurrence for creating lists etc. So instead of learning simple PHP, they have to learn smarty based code instead. This is where the arguments about its usefulness come into play. It's also argued that smarty can be quite a bloated implementation for simple applications, which however still may require this layered separation of concerns.

I haven't used smarty myself as it always seemed OTT for my needs. But if you're creating a large application with many team members working on it, it's an option.

suzkaw
12-02-2005, 01:07 PM
We recently starting using smarty in our software. So far it has been a good decision and makes it easier for novices to modify their site layouts. I would prefer not to use it but it does save us on technical support issues.