473,800 Members | 2,696 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Smarty and template alternatives

I like Smarty but I may have to design something similar myself, bc I'm
having trouble getting it installed on my Shared WebHost.

There are good examples out there. One on CodeWalkers
http://codewalkers.com/tutorials/58/1.html

I read a great book once, Enterprise Java, by Jeff Genender, that had
an advance template system, with caching, etc. built into it.

I'm giving another try to do a Smarty installation. After that, are
there any good alternatives ?

Dec 2 '05 #1
5 2906
I have heard good reports about http://www.tinybutstrong.com/.

Dec 2 '05 #2
"webguynow" <in*****@rcn.co m> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
I'm giving another try to do a Smarty installation. After that, are
there any good alternatives ?


Hi,

I am obviouslly biased, but you could try TemplateTamer. It is comming
together with development enviroment to make your template porgramming
easier, allows you to have your html and programming logic separated in
completely different files, it encourages OO approach, it has provisouns
that allow you to implement advanced and flexible cacheing, and it does not
need installation on server.

If you would need any help with it, just e-mail me.

rush
--
http://www.templatetamer.com/
http://www.folderscavenger.com/
Dec 5 '05 #3
webguynow (in*****@rcn.co m) wrote:
: I like Smarty but I may have to design something similar myself, bc I'm
: having trouble getting it installed on my Shared WebHost.

: There are good examples out there. One on CodeWalkers
: http://codewalkers.com/tutorials/58/1.html

: I read a great book once, Enterprise Java, by Jeff Genender, that had
: an advance template system, with caching, etc. built into it.

: I'm giving another try to do a Smarty installation. After that, are
: there any good alternatives ?
Since this is mine, I shan't say if it is "good" or not, but it's free to
use if you wish

http://nisoftware.com/tnt/ (Stands for "TiNy Template").

It doesn't need an "install" as such, it is just a php file that you can
include with an app and "require" as needed. It is tested in php 4 on
Linux, and uses the basic xml parser that comes with php 4. It generates
php code that can be cached (or not as you wish) by specifying a
(writable) cache directory, or you can generate the compiled template
ahead of time so it can be used without even including the template
modules with the application.

Dec 5 '05 #4
I'm a little wary of XML based solutions, because it sometimes seems
slow. That being said I've written a few great reports using XML /
XSL. Still evaluating, but requirements are:

-should be fast
-should support looping and blocks
-caching is preferred, for performance.

While there are nearly 100 template systems for PHP that have been
introduced, its a little time consuming evaluating them, and it would
be nice to know which are current.
I found an interesting list on sitepoint
http://www.sitepoint.com/forums/show...hreadid=123769

Dec 21 '05 #5
So I've been evaluating templates and architectures:
-T. Marston variant -
methodolgy is sound, wish I had 3 semesters to learn it, I gave up
after 200 pgs
- phpWACT
also like this, appreciate the comprehensive approach and XML, but
XML parse may slow this down
- Smarty, well known, Pros: easy to use; Cons: Heavy weight, less
portable due to Pear installation issues on webhosts
- TinyButStrong (TBS) Pros: small and flexible; Cons: non-standard
API is detailed
- PHP alone -

Obviously, comparison at a glance, is like apples and oranges.
Marston / WACT solutions extend beyond templates, use Design Pattern
solutions.

I really don't want any specific template code in my php; Makes me wish
for a layer.

As far as analysis or roll-your-own solution, How hard could this be ?
The code I've seen reads a template, and creates an array of
static/placeholder, ....
Then cycles through and does replacements to create the output.

caching ? Date check and then possible reload ?
compiling ? What exactly is this ? some sort of compression
Ways to stress test ? performance evaluations ?

In terms of efficiency, I've also considered ways to keep things in
memory, static?, like PHP's "Persistent Database Connections" (PDC).
If PDC is effectively implemented through Apache, multiprocess Srv,
parent/child,
where parent keeps the Conn open, and hands it off to a child, ...
What about template code and template objects ? Should they be
loaded/discarded on every PHP request ? ( Mine will be a medium usage
site 200-500 hits / hour )
Does Apache cache any of this ?

Re: FC Front Controller
I've heard the raging debates, and most dev's are against the FC model.
I've always thought they would be good, only if you needed to modify
the request.
I suppose that any PHP objects would only be retained in memory if the
script was running in an endless loop - but that's Apache's job to
listen and take requests.

Any suggestions, I'll be glad to hear them. TIA

Dec 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
15487
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 inside a string variable. Take this example:
2
2517
by: Brian | last post by:
I have an application that uses an array of values as a "lookup" table and smarty as a template engine. $lookup = "label"; $lookup = "label2"; $lookup = "label"; $lookup = "label2"; In my application I can easily use this array to find the values I need.
2
2917
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
2316
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 is I cannot figure out how to pass value between smarty and PHP. Going from php to smarty I've tried this: {php} $smarty = new Smarty; $smarty->assign("x", 100);
0
1286
by: Martin Meng | last post by:
Is Smarty really secure enough to open up the template source to members from the general public (albeit registered user, screened, identity verified)? My application calls for customiszble skinning. i.e. it is desirable to allow customer sites edit their own templates. I wonder if a bad template could badly screw up my central server? I have the {php} tags turned off, and have the allowable php functions in {if} tags restricted to...
0
1609
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 new name and refresh the browser, it maintains the old value instead of updating to the new value. Both index.php and SmartySetup.class.php appear below: index.php:
7
6215
by: Man-wai Chang | last post by:
1. How could concatenate two values into a string in the template? {section name=j start=0 loop=10 step=1} {section name=k start=0 loop=10 step=1} {assign var=xx value=concat($smarty.section.j,$smarty.section.k)} {xx} {/seection} {/section} 2. How could I address/use associative array in the template? I could do
2
2072
by: Gene | last post by:
i'm newcomer in using smarty and i have problem like this: i want to have one template file (e.g. index.tpl) in this file section which use variable {$content}. and two files *.php which are using the same template index.tpl and only change the content. for example: /*index.php*/ $smarty = new MySmarty(); $smarty->assign('content','INDEX');
0
2160
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 { .. .. ..
0
9691
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10507
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10255
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10036
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7582
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4150
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2948
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.