473,379 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Opinions on Smarty

TheServant
1,168 Expert 1GB
Hi guys,
I have been on a long journey recently learning OOP, Smarty, and a few other tricks and tools of the trade. I have however reached a crossroads on the point of whether or not I should use Smarty.
I don't mean to sound arrogant (I probably sound naive), but Smarty doesn't look like it does much that I couldn't do myself (with minimal effort) in the area of templates?
Whether I use {title} or <?php echo $title; ?> seems to be the only noticable advantage, seeing as I do both the html and php. I also imagine that the compiler is a bit more technical, but it has to be processed by php anyway, so extra parsing surely takes more time?
Do you use Smarty and what are your thoughts about template libraries?
Sep 13 '09 #1
4 1538
dlite922
1,584 Expert 1GB
I use it, I Love it.

It's more secure syntax (than PHP's echo commnd, you never know). It's easier to manage update, change. It's got lots of great functions that I use and I can create my own modifiers in a blink of an eye. It does not slow your scripts down much at all, so performance is not an issue. It also has the ability to cache as well. (Like your homepage that doesn't change very often), you can cache it to a update every hour, on a busy server this is a performance gain, not loss.

If it was up to me, every PHP OOP MVC would use Smarty for the view. Judging by its popularity, I think it's getting there.

I've never looked back and I don't ever type echo anymore unless I'm troubleshooting something, for troubleshooting even, I usually use var_dump.
Oct 8 '09 #2
TheServant
1,168 Expert 1GB
Great post. Thanks for that. I am becoming a 99% PHP OOP MVC kinda guy, so your confidence in it not causing a performance loss, but even possible a gain, suggests that I should spend some more time integrating it with all my future apps.
Oct 8 '09 #3
Markus
6,050 Expert 4TB
I don't think I've ever used a templating library.. although, I can see the benefits.

Dan, can you elaborate on the security improvements?

TheServant, don't get too caught up with OOP - it's not an answer for everything.

Take care,
Mark.
Oct 9 '09 #4
TheServant
1,168 Expert 1GB
@Markus
Thanks Mark,
It finally clicked the other day as to how I can use it and achieve what I was trying to do with my own variations for ages... But don't worry, I think it's just that honeymoon period of finding a new tool... It's like when I buy a new hammer or drill, everything starts looking like a nail or something that needs a hole...
Oct 11 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Brian | last post by:
Hello, I am trying to work out how to have smarty use a string's contents as the display-> template.. ie: $smarty->display($buffer); obviously $buffer isn't a filename, but a smarty template...
2
by: Daan | last post by:
Hello all, I'm having a little problem with Smarty. Getting it to work in a simple case went fine, but now I have the following situation: / /smarty /templates template.tpl /templates_c
1
by: Richard | last post by:
I need help. I have a smarty based program that I am modifying. I have a smarty template file that consists of smarty and HTML. I need to integrate some PHP database calls into it. My problem...
2
by: M | last post by:
Hi Folks, I am trying to install Smarty using PHP 5 on a Windows XP PC using IIS v6 The following PHP File: <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head>
0
by: Matt | last post by:
geez, i've done this a million times, you'd think i could get it right. uploading to production server for a new site, and part of the head.inc that starts everything up looks like this: echo...
0
by: Conrad | last post by:
Hi, I'm very new to Smarty Template Engine and I'm using PHP 5.0.4 on the Windows XP Professional platform and I have the following question: When I change the 7th line of the script to use a...
0
by: ev45ive | last post by:
Hi! I have smth. like this: file.php: <?php SmartyValidate::connect($smarty); //SmartyValidate::register_form('register');
0
by: grezlik | last post by:
Hi! I have major problems with cakephp & smarty, (cake ver is 1.2 and smarty 2.6.18 ) there is a code (from cake/libs/view/view.php class SmartyView { .. .. ..
1
by: ajaymohank | last post by:
hello friends.......... i am new to smarty. can anyone please tell me how to get the value from a dynamically generated checkbox using smarty. this is the code i used... here i am generating 10...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.