Why use Smarty?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
youropensource
Forum Commoner
Posts: 26
Joined: Tue Aug 05, 2008 11:42 am

Why use Smarty?

Post by youropensource »

Why use Smarty Engine ?
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Why use Smarty?

Post by jayshields »

For templating?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Why use Smarty?

Post by alex.barylski »

Unless your forced into using Smarty (employer/client) don't bother. Use a PHP alternative syntax template engine or just implement one yourself.

Google bTemplate and read that. It does the same thing at a fraction of the cost -- both in learning curve and execution speed.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Why use Smarty?

Post by onion2k »

PCSpectra wrote:Google bTemplate and read that. It does the same thing at a fraction of the cost -- both in learning curve and execution speed.
Last updated in 2003. That's a little disconcerting.

I agree that Smarty isn't a particular good choice though. It's huge. TemplateLite is a better bet. But even that has been almost 2 years since the last update...
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Why use Smarty?

Post by alex.barylski »

Last updated in 2003. That's a little disconcerting.
Why? It's principle and practice remains the same today as it did back then.

But at least we agree on the most important point that Smarty is a bad choice. :P
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Why use Smarty?

Post by onion2k »

PCSpectra wrote:Why? It's principle and practice remains the same today as it did back then.
Well, it'll have been written for PHP 4.2 at the latest, there'll be no unit tests, there'll be 5 years worth of potentially unpatched holes and exploits, and any bugs or missing features definitely won't be added by the original author. It was only at version 0.3 at the last change, which may well work ok but it's far from a stable major release.

I'm not saying it's unusable or it won't do the job. I'm saying it's disconcerting to use software that's apparently been abandoned in case there are problems. I like the idea of there being some sort of support if absolutely necessary.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Why use Smarty?

Post by alex.barylski »

Well, it'll have been written for PHP 4.2 at the latest, there'll be no unit tests, there'll be 5 years worth of potentially unpatched holes and exploits, and any bugs or missing features definitely won't be added by the original author. It was only at version 0.3 at the last change, which may well work ok but it's far from a stable major release.
I see. You dissecting it way more than I did. I was simply looking at it from the most basic implementation like follows:

Code: Select all

 
ob_start();
include($file_to_template);
$buff = ob_get_contents();
ob_end_clean();
 
return $buff;
 
I wouldn't bother using bTemplate itself but the core idea has remain unchanged.
I'm not saying it's unusable or it won't do the job. I'm saying it's disconcerting to use software that's apparently been abandoned in case there are problems. I like the idea of there being some sort of support if absolutely necessary
Agreed. I didn't really assume anyone would use bTemplate itself as it's so simple in it's basic form (like I show above) I figured most would just develop their own specific to their needs.

Cheers,
Alex
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Re: Why use Smarty?

Post by jmut »

Currently only reason I'd use smarty is to allow client make custom templates and via smarty don't allow him for full power of php.
Post Reply