flexy vs smarty

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gumshoo3@yahoo.com

    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,conta ct">
    <td>{contact.na me}</td>
    <td>{contact.st reet}</td>
    <td>{contact.ci ty}</td>
    <td>{contact.st ate}</td>
    <td>{contact.zi p}</td>
    </tr>
    </table>


    Thanks in advance for your kind response,
    -Rich

  • Jan Pieter Kunst

    #2
    Re: flexy vs smarty

    gumshoo3@yahoo. com wrote:
    [color=blue]
    > 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).[/color]

    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.

    Comment

    • gumshoo3@yahoo.com

      #3
      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.

      Comment

      • gumshoo3@yahoo.com

        #4
        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.

        Comment

        • Jan Pieter Kunst

          #5
          Re: flexy vs smarty

          gumshoo3@yahoo. com wrote:
          [color=blue]
          > And the Golden Newbie Award goes to... Smarty.
          >
          > Once I learned to change the delimiter to avoid javascript, that is...[/color]

          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.

          Comment

          • gumshoo3@yahoo.com

            #6
            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...

            Comment

            Working...