flexy vs smarty

This is a discussion on flexy vs smarty within the PHP Language forums, part of the PHP Programming Forums category; Hello, These two seem about equal, however I'm leaning towards Flexy. Here's my reasoning below, anything missing? (I'...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2005
gumshoo3@yahoo.com
 
Posts: n/a
Default flexy vs smarty

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
there)

Both are trivial to introduce to the project in terms of setup.

Both achieve HTML template pages and code-behind pages.

Smarty seems to have been around longer and is the templating engine
underneath Tiki.

Flexy has PEAR status, in addition seems to be doing the "right
thing" in terms of expressing the templating within attributes (much
like ATG Dynamo Droplets did the right thing, but was overruled by
marketing). So in this case engineering and marketing are aligned
(Flexy is the one with PEAR status).

These two examples are both actually well-formed, but Smarty
accomplishes it's task with the "markup code" outside of tags,
and Flexy does it within attributes.

For example a loop in Smarty:

<table>
{section name=mysec loop=$users}
{strip}
<tr bgcolor="{cycle values="#aaaaaa,#bbbbbb"}">
<td>{$users[mysec].name}</td>
<td>{$users[mysec].phone}</td>
</tr>
{/strip}
{/section}
</table>



Versus a loop in Flexy:



<table class="wide" cellpadding="5">
<tr>
<th>{translate(#Name#)}</th>
<th>{translate(#Street#)}</th>
<th>{translate(#City#)}</th>
<th>{translate(#State#)}</th>
<th>{translate(#ZIP Code#)}</th>
</tr>
<tr flexy:foreach="aContacts,contact">
<td>{contact.name}</td>
<td>{contact.street}</td>
<td>{contact.city}</td>
<td>{contact.state}</td>
<td>{contact.zip}</td>
</tr>
</table>


Thanks in advance for your kind response,
-Rich

Reply With Quote
  #2 (permalink)  
Old 02-28-2005
Jan Pieter Kunst
 
Posts: n/a
Default Re: flexy vs smarty

gumshoo3@yahoo.com wrote:

> Flexy has PEAR status, in addition seems to be doing the "right
> thing" in terms of expressing the templating within attributes (much
> like ATG Dynamo Droplets did the right thing, but was overruled by
> marketing). So in this case engineering and marketing are aligned
> (Flexy is the one with PEAR status).


I'm not familiar with Flexy (I use Smarty), but as far as 'status' goes,
you could say that Smarty has 'PHP status':

<http://smarty.php.net/>

JP

--
Sorry, <devnull@cauce.org> is a spam trap.
Real e-mail address unavailable. 5000+ spams per month.
Reply With Quote
  #3 (permalink)  
Old 02-28-2005
gumshoo3@yahoo.com
 
Posts: n/a
Default Re: flexy vs smarty

Thanks, Well I'm still confused.

The PHP5 Power Programming book gives a Smarty-like Flexy example!!

With { } script outside of tags. It doesn't even show the strong
example for Flexy--the foreach within a table.

Blowin back towards Smarty...

Whichever setup runs first I'm going with.

Reply With Quote
  #4 (permalink)  
Old 02-28-2005
gumshoo3@yahoo.com
 
Posts: n/a
Default Re: flexy vs smarty

And the Golden Newbie Award goes to... Smarty.

Once I learned to change the delimiter to avoid javascript, that is...

Smarty docs much better than Flexy. Seems like a lot more functions.
Seems more solid.

Also Flexy is a Pear package, doesn't seem to want to install unless
you run pear to convert all the paths to each installation.

Reply With Quote
  #5 (permalink)  
Old 03-01-2005
Jan Pieter Kunst
 
Posts: n/a
Default Re: flexy vs smarty

gumshoo3@yahoo.com wrote:

> And the Golden Newbie Award goes to... Smarty.
>
> Once I learned to change the delimiter to avoid javascript, that is...


I usually use {literal} {/literal} around Javascript code if I put it
directly in a Smarty template.

JP

--
Sorry, <devnull@cauce.org> is a spam trap.
Real e-mail address unavailable. 5000+ spams per month.
Reply With Quote
  #6 (permalink)  
Old 03-02-2005
gumshoo3@yahoo.com
 
Posts: n/a
Default Re: flexy vs smarty

Using Smarty for SQL templates now, muhahahahaha..

(gets the hairy SQL out of the code for sharing and maintenance)

Template everything dammit.

So much for any concern about attributes in tags...

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:36 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0