Jump to content

Smarty: Is it worth using?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
11 replies to this topic

#1
Calgon

Calgon

    Learning Programmer

  • Members
  • PipPipPip
  • 56 posts
I'm working on a new web application written in PHP, (My)SQL, HTML/CSS and Javascript/Ajax, but I'm wondering whether I should use Smarty or just use raw HTML in files, or whether it's generally worth using Smarty?

Anyone have anything to say?

#2
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
I know Orjan likes Smarty. I'd personally suggest WordPress. Whatever program you decide I'd probably stray away from HTML files unless you never plan on updating the website, or doing so very rarely.

I suppose it really depends on what you want to achieve with the website.

#3
Calgon

Calgon

    Learning Programmer

  • Members
  • PipPipPip
  • 56 posts

BlaineSch said:

I know Orjan likes Smarty. I'd personally suggest WordPress. Whatever program you decide I'd probably stray away from HTML files unless you never plan on updating the website, or doing so very rarely.

I suppose it really depends on what you want to achieve with the website.

I'm making a web based organizing application, so Wordpress is hardly an option as I'd have to customize so much.

Thanks for your input though, I do believe that using Smarty instead of stray files with HTML in would be more beneficial, but is it worth getting used to the Smarty API and building a whole application/site based around the Smarty Template System?

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
It may seem interesting at first but saves an awful amount of time and maintenance rather than doing it all by hand, I would most certainly learn a templating system in a new project that requires a lot of customized fronts.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
Calgon

Calgon

    Learning Programmer

  • Members
  • PipPipPip
  • 56 posts

Nullw0rm said:

It may seem weird at first but saves an aweful amount of time and maintenance rather than doing it all by hand, I would most certainly learn a templating system in a new project that requires a lot of customized fronts.

Have you used Smarty or any other alternatives? I just want to make sure that if I do use a template system, I'm using the best/most efficient available.

#6
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
I believe it has the most robust caching implementation of all the template engines I had tried, it sure is efficient from that perspective.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#7
Calgon

Calgon

    Learning Programmer

  • Members
  • PipPipPip
  • 56 posts

Nullw0rm said:

I believe it has the most robust caching implementation of all the template engines I had tried, it sure is efficient from that perspective.

Thank you again for the help then. :)

#8
Vladimir

Vladimir

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
The best template engine available for PHP is Twig: Twig - The flexible, fast, and secure template engine for PHP . At the second place goes JustPlainPHP. To find a prove you can check what template engines use two most popular PHP frameworks: Symfony2 and Zend Framework.

#9
Calgon

Calgon

    Learning Programmer

  • Members
  • PipPipPip
  • 56 posts

Vladimir said:

The best template engine available for PHP is Twig: Twig - The flexible, fast, and secure template engine for PHP . At the second place goes JustPlainPHP. To find a prove you can check what template engines use two most popular PHP frameworks: Symfony2 and Zend Framework.

Would you mind explaining why you think it's better than Smarty then? Seeing as everyone else is in favour of Smarty and they've pretty much already stated that it's generally efficient and from what I've heard from others, it's generally secure.

#10
Vladimir

Vladimir

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
Check main page of Twig and compare listed features with Smarty.

#11
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
Yes, I like and use Smarty alot. There is other template engines out there, but I haven't learned them. I find Smarty stable and good working, dynamic and good enough for most usage. I can't tell if it's better or worse than others, but I find Smarty do all work I want in a good way. I have written a three-parted tutorial to introduce Smarty which can be found in the php tutorial section.

If you choose Smarty or something else, it's up to you, but as you seem to have a project ahead that need a high level of own work, so a CMS like WordPress, Drupal or Joomla won't work, I highly recommend to use a template system. It eases both the layout and the behind the scene-code, as you don't have to think of output order in your normal code.

I would use Smarty as I know it.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#12
Calgon

Calgon

    Learning Programmer

  • Members
  • PipPipPip
  • 56 posts

Orjan said:

Yes, I like and use Smarty alot. There is other template engines out there, but I haven't learned them. I find Smarty stable and good working, dynamic and good enough for most usage. I can't tell if it's better or worse than others, but I find Smarty do all work I want in a good way. I have written a three-parted tutorial to introduce Smarty which can be found in the php tutorial section.

If you choose Smarty or something else, it's up to you, but as you seem to have a project ahead that need a high level of own work, so a CMS like WordPress, Drupal or Joomla won't work, I highly recommend to use a template system. It eases both the layout and the behind the scene-code, as you don't have to think of output order in your normal code.

I would use Smarty as I know it.

Thanks for your input. I've decided to stick with Smarty as I've already learned the basic usage of it and started work on my site and produced some Smarty templates for it.