473,398 Members | 2,335 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,398 software developers and data experts.

Smarty or Pear - anyone else?

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
6 2540
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sebastian Benner | last post by:
Hi, what are your experiences with Smarty and PEAR/HTML_Progress? http://pear.laurent-laville.org/HTML_Progress/apidoc/HTML_Smarty/default/ I tried it, but having difficulties producing a...
2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
5
by: gumshoo3 | last post by:
Hello, These two seem about equal, however I'm leaning towards Flexy. Here's my reasoning below, anything missing? (I've searched but can't find much discussion of smarty vs flexy out...
1
by: DJ Majestik | last post by:
OK, I am new to the whole PEAR/Smarty templating thing. I am trying to setup my directory structure correctly. If someone could weigh in and see if I have this setup "right", I would appreciate it....
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...
7
by: William Krick | last post by:
I'm fairly new to PHP and Smarty templates and I don't understand... $smarty = new Smarty; ....vs... $smarty = new Smarty(); ....vs...
1
by: IchBin | last post by:
I remember having problems with pear when I first installed it but got it running some time ago. This is on a windoze XP SP OS. I did not think it was correct because it pointed to...
5
by: Dan Fulbright | last post by:
I'm trying to install PHP 5.2.2 on Windows, but I keep getting errors when running go-pear.bat: mmap cache can't open phar://go-pear.phar/index.php mmap cache can't open...
7
by: diane100 | last post by:
Hi I am new to PHP and Smarty (I know only very basic things) and I need help with a warning message I get when I call a page in a browser. I purchased some software from a company who are no...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.