Connecting Tech Pros Worldwide Help | Site Map

Smarty and template alternatives

webguynow
Guest
 
Posts: n/a
#1: Dec 2 '05
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 ?

Sean
Guest
 
Posts: n/a
#2: Dec 2 '05

re: Smarty and template alternatives


I have heard good reports about http://www.tinybutstrong.com/.

rush
Guest
 
Posts: n/a
#3: Dec 5 '05

re: Smarty and template alternatives


"webguynow" <invinfo@rcn.com> wrote in message
news:1133487658.058019.322040@g47g2000cwa.googlegr oups.com...[color=blue]
> I'm giving another try to do a Smarty installation. After that, are
> there any good alternatives ?[/color]

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/


Malcolm Dew-Jones
Guest
 
Posts: n/a
#4: Dec 5 '05

re: Smarty and template alternatives


webguynow (invinfo@rcn.com) 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.

awebguynow
Guest
 
Posts: n/a
#5: Dec 21 '05

re: Smarty and template alternatives


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

awebguynow
Guest
 
Posts: n/a
#6: Dec 23 '05

re: Smarty and template alternatives


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

Closed Thread