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'...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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. |
|
|||
|
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. |
|
|||
|
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. |
|
|||
|
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. |