On 27.09.2010, at 20:44, Nathanael D. Noblet wrote:

> On 09/27/2010 06:30 AM, naholyr wrote:
>> As PHPView remains a embedded engine accessible via a simple option,
>> the "template versus plain PHP" is meaningless.
>> 
>> The real question in my opinion is : "why Twig ?"
>> OK, we know why, it's because Symfony's team (or Fabien only ?) wrote
>> it and wants to use it. OK, that's a point.
>> 
>> But why don't you rely on a already-made engine ? Like Smarty,
>> TinyButStrong, PHPLib, or any other aged template engine that has
>> proven its reliability, power, extensibility, or whatever is the main
>> criteria to decide which engine to include.
>> Twig is nice and everything, but it will never be as powerful as
>> Smarty (including community-plugins), neither will it be wysiwyg-
>> compatible as TBS, or lightweight as PHPLib+cache.
>> 
>> The use of a template engine is fully positive in my opinion, but it's
>> just like the Mailer engine, it should be a third-party library.
>> 
> 
> I had to work on a project that uses smarty, I absolutely detest it. Its the 
> worst invention and I don't see the point. I honestly don't get how it is any 
> cleaner/easier to understand to a non-dev, nor how it helps in anyway. The 
> only thing I can think is in escaping output. Are there other benefits other 
> than those two? I'd really like to know why people find stuff like smarty 
> useful.

you can do stuff like foreach/else or add a syntax to efficiently deal with 
zebra stripe lists. the point is you can optimize the syntax for display logic 
(formatting text, escaping, iterating over stuff, i18n/l10n, maybe a bit of 
caching). interestingly enough for example for escaping by default such 
template engines are way more efficient that having to decorate or auto escape 
everything like is done in the symfony 1.x template engine.

that being said, all template engines that compile to php also allow you to 
fallback to plain php if you have to. then again you really never should have 
to unless the framework you are using is limiting your capabilities in the 
model or controller in unfortunate ways. but if you do fallback to php, it will 
at least scream "warning warning" to anyone reviewing the code.

regards
Lukas Kahwe Smith
m...@pooteeweet.org



-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to