473,698 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Jul 17 '05 #1
5 4785
gu******@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, <de*****@cauce. org> is a spam trap.
Real e-mail address unavailable. 5000+ spams per month.
Jul 17 '05 #2
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.

Jul 17 '05 #3
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.

Jul 17 '05 #4
gu******@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, <de*****@cauce. org> is a spam trap.
Real e-mail address unavailable. 5000+ spams per month.
Jul 17 '05 #5
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...

Jul 17 '05 #6

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

Similar topics

4
15480
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
2904
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
2309
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);
2
2605
by: M | last post by:
Hi Folks, I am trying to install Smarty using PHP 5 on a Windows XP PC using IIS v6 The following PHP File: <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head>
0
1583
by: Matt | last post by:
geez, i've done this a million times, you'd think i could get it right. uploading to production server for a new site, and part of the head.inc that starts everything up looks like this: echo SMARTY_DIR."Smarty.class.php<br>"; require_once(SMARTY_DIR."Smarty.class.php"); if (substr(phpversion(),0,1) == "4") { $smarty = new Smarty;
0
1604
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:
0
2808
by: ev45ive | last post by:
Hi! I have smth. like this: file.php: <?php SmartyValidate::connect($smarty); //SmartyValidate::register_form('register');
0
2154
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 { .. .. ..
1
2617
by: ajaymohank | last post by:
hello friends.......... i am new to smarty. can anyone please tell me how to get the value from a dynamically generated checkbox using smarty. this is the code i used... here i am generating 10 checkbox. but i am not getting the value when each checkbox is checked. the value is coming from the array $profservices. how can i get the value from each checkbox when they are selected. also i have a "Select all" checkbox generated. how will i write...
0
8674
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
8603
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,...
1
8893
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
8861
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
7721
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
6518
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...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4615
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1999
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.