Forum Moderators: coopster

Message Too Old, No Replies

Smarty PHP libraries

Are they a smart thing to use?

         

olwen

10:21 am on May 11, 2003 (gmt 0)

10+ Year Member



I've been reading up on the Smarty libraries. DO other use them, and are they a good as they seem?

eaden

11:57 am on May 11, 2003 (gmt 0)

10+ Year Member



yes and yes.

They aren't suited to EVERY project, but for the average php website they are great!

Very powerful too, you can do all sorts of neat tricks.

Nick_W

12:00 pm on May 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>tricks

It's actually quite astonishing the amount of stuff that smarty can do. I've been working on a more complex project recently and Smarty's functionality is saving me soooo much coding time, not only that, it's advanced cache features are superb.

I couldn't recommend smarty any higher, it's an outstanding application and well worth the 10-15mins it takes to set up...

Nick

ShawnR

1:57 pm on May 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A related question: Are there any complications in using Smarty with a generic ISP host? i.e. Does the ISP need to have Smarty installed/configured? Do you need PEAR installed?

Shawn

eaden

2:16 pm on May 11, 2003 (gmt 0)

10+ Year Member



Smarty doesn't reqire anything like PEAR or whatever. It's a php class ( Smarty.class.php ) that you include in your files.

I really_really reccomend it.
Along with ez_sql.php it's in my top 2 best alltime free php classes that I use everyday in my work.

ruserious

9:10 pm on May 13, 2003 (gmt 0)

10+ Year Member



Although one may wonder why you have to learn yet another language (the smarty-tags), when everything that smarty does can be done just as well (and possibly faster) with 'plain PHP'...

As e.g. explained here:
[massassi.com...]

eaden

9:29 pm on May 13, 2003 (gmt 0)

10+ Year Member



Although one may wonder why you have to learn yet another language (the smarty-tags), when everything that smarty does can be done just as well (and possibly faster) with 'plain PHP'...

and refuted here
[phpinsider.com...]

[edited by: jatar_k at 10:18 pm (utc) on May 13, 2003]
[edit reason] removed link from quote [/edit]

ruserious

10:23 pm on May 13, 2003 (gmt 0)

10+ Year Member



Hi eaden,

thank you for the link. Interesting discussion, as it is probably only fair to show both sides of the issue. I read the dicsussion and the linked articles/discussions, and I still stand with the point I made above. As with many techniques in programming, there will always be disagreement on several subjects. However you have to know and evaluate the pros and cons of the matter yourself, and then make your choice accordingly.

The admin of the smarty makes a very important point: In the end, it is not any template enige that seperates business logic from presentation logic, it is the right use of both developers/designers. And once you agree that you have to use discipline you can just as well use pure PHP and just keep your templates seperate. No need for additional layers...

My advice would be: If your only going to use it for a homepage/personal db-driven website go with smarty, as it is also nice to have a whole set of functionalities that smarty brings with it that go beyond templating.
But if you are serious about PHP development, or if you are going to be making commercial sites, programm your own approach as mentioned in the above mentioned article.

olwen

10:42 pm on May 13, 2003 (gmt 0)

10+ Year Member



Along with ez_sql.php it's in my top 2 best alltime free php classes that I use everyday in my work.

Thanks for the pointer to ez_sql. I'd been wondering about database classes. I'm trying to move towards OOP, but it's very confusing for an old lady without a bit of help.

Wandering off now wondering if there's a bowl of COBOL lying around somewhere

SEO practioner

2:13 am on May 14, 2003 (gmt 0)

10+ Year Member



" Along with ez_sql.php it's in my top 2 best alltime free php classes that I use everyday in my work "

- - - - -

Eaden: I am seriously considering building a new site in PHP and I will need a database. Judging from what you just said, would it be a good idea for me and just how good / fast is ez_sql.php?

thanks

eaden

7:44 am on May 14, 2003 (gmt 0)

10+ Year Member



Eaden: I am seriously considering building a new site in PHP and I will need a database. Judging from what you just said, would it be a good idea for me and just how good / fast is ez_sql.php?

Well, ez_sql.php is pretty cool. It turns long ugly messy mysql_ code into clean code. I have use ezsql all the time now, and I think i have forgotten how to do ordaniry db lookups with mysql. Just check out the site for examples on how to use it. It's good because it's easy / clean to code. Most things can be done in one line.