Jump to content

Recommended Posts

I noticed Smarty hadn't received an update in a few months dating back to last year (up until recently) and with a lot of talk I've been hearing recently about PHP as its own templating language being the best option I turn to you guys:

 

Is Smarty still a good choice and in what cases?

 

For example: How well does Smarty + MVC Framework (Zend, Yii, etc) perform?

 

I realize that Smarty is probably the best templating engine for PHP out there but I've become slightly discouraged recently... how many of you actually use it on a regular basis?

 

Thanks!

 

Alex

Link to comment
https://forums.phpfreaks.com/topic/160587-smarty-template-still-viable/
Share on other sites

I've use smarty in the past, not a huge fan though.

 

I prefer to use php to separate my logic from my presentation by using classes etc.

As far as i'm concerned it works just as well

 

I dont see the point of using something else to do what php can do itself.

 

BTW I fear you may have opened a can of worms here  ;)

 

Just my 2 cents

Many projects continue to use smarty.  It hasn't changed much because it's been relatively stable.  Some people love smarty and others hate it.  At the end of the day the goal of smarty is to seperate the markup related code from program logic, as well as adding in page caching.  It should be pointed out that at the time, smarty only addressed the markup side of the issue, and left the rest of it to be solved by others.  Now there are any number of mature php frameworks out there that have a complete top to bottom solution to the problem.

 

Smarty can be used with newer frameworks.  I worked on a project recently where Zend framework was used for the server side code, while the UI/frontend was all done with smarty templates.  Ultimately it was my opinion that the templates ended up with way too much business logic in them, but it certainly worked acceptably. 

 

If you already know smarty very well and are productive in it, then it continues to be a viable option.  With that said, I think it's rather long in the tooth at this point, and would prefer something that was native to whatever framework I was working in, so long as those frameworks provided at least as much seperation and functionality as well as the same caching capabilities.  Caching is certainly important in a lot of high traffic scenarios.

I prefer to use php to separate my logic from my presentation

 

I dont see the point of using something else to do what php can do itself.

 

BTW I fear you may have opened a can of worms here  ;)

 

Ditto on all three points!  Plus it's one less set of syntax to memorize which is always good for the Alma mater.

thanks for the replies and that's kind of what I was expecting to hear! :)

 

I've read up on Smarty in the past and done a few small things but there was always a lot of business logic going on specially when passing objects to the view...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.