By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

Smarty or Pear - anyone else?

P: n/a
Im programer (about 2 years ago I started), and allways I use PEAR.
and Now I was thinking about change my tool for building custom
dynamic sites.
What do you think sholud be better Smarty, may be Pear or another one?
Why?
I need your comments and experience. Thanks 4 your time.

Alvaro J Vera Alvarado
VNC SFE.-

May 5 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On May 5, 5:33 pm, "alvarojavierv...@gmail.com"
<alvarojavierv...@gmail.comwrote:
What do you think sholud be better Smarty, may be Pear or another one?
Why?
I've never used a PEAR templating engine. I have used Smarty and spin-
offs of it, and I am pretty satisfied with that. Try TemplateLite for
a more efficient alternative to Smarty if you're willing to sacrifice
minimal stability (I've only noticed a few small times when it messed
up, I've never not been able to work around them):
http://templatelite.sourceforge.net/

TemplateLite also appears to be missing some features Smarty has, I
think it doesn't give you the option of writing your own cache
handling function.

-Mike PII

May 5 '07 #2

P: n/a
al**************@gmail.com kirjoitti:
Im programer (about 2 years ago I started), and allways I use PEAR.
and Now I was thinking about change my tool for building custom
dynamic sites.
What do you think sholud be better Smarty, may be Pear or another one?
Why?
I need your comments and experience. Thanks 4 your time.

Alvaro J Vera Alvarado
VNC SFE.-
I wouldn't compare PEAR and Smarty, those are two different things for
different purpouse. Smarty is a template engine and PEAR is more like an
web application framework. So your question is like which is better, a
tiger or tuesday. I don't know how to answer that... ;)

--
Ra*********@gmail.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze
May 5 '07 #3

P: n/a
On May 5, 7:53 pm, Rami Elomaa <rami.elo...@gmail.comwrote:
I wouldn't compare PEAR and Smarty, those are two different things for
different purpouse. Smarty is a template engine and PEAR is more like an
web application framework.
I assumed he meant some template engine that's in PEAR

-Mike PII

May 6 '07 #4

P: n/a
Mike P2 kirjoitti:
On May 5, 7:53 pm, Rami Elomaa <rami.elo...@gmail.comwrote:
>I wouldn't compare PEAR and Smarty, those are two different things for
different purpouse. Smarty is a template engine and PEAR is more like an
web application framework.

I assumed he meant some template engine that's in PEAR
Ah, I see. :)

--
Ra*********@gmail.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze
May 6 '07 #5

P: n/a
al**************@gmail.com napisał(a):
Im programer (about 2 years ago I started), and allways I use PEAR.
and Now I was thinking about change my tool for building custom
dynamic sites.
What do you think sholud be better Smarty, may be Pear or another one?
Why?
I need your comments and experience. Thanks 4 your time.

Alvaro J Vera Alvarado
VNC SFE.-
If you need templating system, SMARTY is for sure 1. in terms of
stability and community. It's also well documented.
Major downsides are:
- syntax is not really php alike, so you have to learn it
- slow compilation

Best feature in SMARTY imho is caching.

If you need alternatives,
take a look at http://opt.openpb.net/
it's way faster then SMARTY, no need to learn new syntax,
has cashing and many usefull features.

Piotr
May 6 '07 #6

P: n/a
al**************@gmail.com wrote:
Im programer (about 2 years ago I started), and allways I use PEAR.
and Now I was thinking about change my tool for building custom
dynamic sites.
What do you think sholud be better Smarty, may be Pear or another one?
Hi Alvaro,

You could try the Composition by inclusion and callback pattern, see
http://www.phppeanuts.org/site/index_php/Pagina/195
Why?
- Makes it easy to build and reuse your own page component classes
- simpelest thing that could possibly work to get strong separation of
layout and php code
- Flexibilty of php available in the include files (must have some
discipline though not to mess up the separation of layout and code).
I need your comments and experience.
I first used it to build pntUnit unit testing tool, which worked to get
the separation of layout and code. Also worked to group user interface
related functions into classes. Then i did the same with a content
managed website.

Later when i built the phpPeanuts framework i used it in combination
with a front controller so i could change the page or component class
without changing the referring url or include call. That makes it much
easyer to delay decisions about specialization until the need really is
manifest.

At first i combined it with a DOM (representing the layout itself in
objects) for finegrained components, like rows and cells in tables, but
that resulted in code that was much harder to read and understand than
the code resulting from following the "composition by inclusion and
callback" pattern. So in the end i refactored the components that used
the DOM. To speed up the inclusion of fine grained reoccuring elements i
added an event handler technique to the table component.

I have been using both the framework and the "composition by inclusion
and callback" pattern for several years and see only one reason to
rethink it: AJAX. Probably the pattern will only have to be extendend by
an AJAX-based inclusion mechanism, but i have not yet tested that theory.

Greetings,

Henk Verhoeven,
www.phpPeanuts.org.
May 8 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.