Zend Certified Engineer

phpguru.org

Free PHP, Javascript and C# code

Using (or not...) Smarty


22nd March 2008, 792 views
> Smarty for all it's maintainers and hoohar, can be a pig's
> ear to write for, and maintain. It gives you too much power,
> which should never really go into a template engine.

I'd have to agree entirely. My preferred template engine is... PHP. No new syntax for me or other developers to learn and your templates will be semi-compiled if you use an accelerator of some sort. [Original]

Top 10 referrering pages

  1. http://www.phpaddiction.com/tags/php/php-weekly-r... (46 referrals)
  2. http://www.akbkhome.com/blog.php/View/160/Another... (12 referrals)
  3. http://www.akbkhome.com/blog.php (6 referrals)
  4. http://www.google.co.uk/custom?domains=www.phpgur... (3 referrals)
  5. http://www.google.com/search?q=smarty+vs+php&hl=e... (1 referrals)
  6. http://www.google.com/search?q=table+editor+mysql... (1 referrals)
  7. http://www.akbkhome.com/blog.php/1/PHP.html (1 referrals)
  8. http://www.google.com/search?q=template+if+not+sm... (1 referrals)
  9. http://www.google.de/search?hl=de&q=smarty+datagr... (1 referrals)
  10. http://www.google.ae/search?q=%7Bif+%7D+smarty+%2... (1 referrals)
- +
Rate this article

Link to me

If you use any of the code on this site (and if you don't I guess) or it makes your life easier, I'd appreciate a link - http://www.phpguru.org. Thanks!

RSS Feed for Comments

Comments

Author: Anonymous
Posted: 22nd March 2008 16:50
Smarty has its uses, but definitely not as the template engine it advertises itself as--PHP alone is good at that.
Quote
Author: Richard Heyes
Posted: 22nd March 2008 16:53
Anonymous:
> Smarty has its uses, but definitely not as the
> template engine it advertises itself as--PHP
> alone is good at that.

So what then?
Quote
Author: Anonymous
Posted: 22nd March 2008 18:34
Richard Heyes:
> So what then?

There are often times when you want to provide a web interface for editing your templates. Of course, editing PHP code in such an interface is not ideal and most people may be confused at first glance. Designers and template creators are people you have to work with all the time and are people who are likely to be familiar with the basic PHP syntax you've provided in your templates.. so it's not for them. It's more of an end-user feature, to provide editable Smarty templates through such an interface.

Smarty also has a useful feature for restricting what features a user can use, ensuring that the user doesn't do something critically stupid to their application and/or server.

Yet, plain PHP is great and (no matter what anyone says) easy to understand for templates.

And this comes from years of experience with several clients and co-workers (including engineers and designers) across several companies.

Smarty has just never been *that useful*.
Quote

Post Comment

Your name:
Your email:
(Don't worry, I won't spam you. Also, if you do put your email address in here, you'll get notified of new comments. If you don't, you won't.)
Comments:
  Do not post support type questions please

 
CAPTCHA image If you can't read the CAPTCHA then press the submit button to get another. Your comment will re-appear (as if by magic...).
Captcha image