stargeek
PHP news website logo.
home    PHP scripts    articles    seo tools    links    search    contact    shop    realtors


Smarty-Light 2.2.1







Smarty-Light 2.2.1

Smarty-Light 2.2.1 08/04/2004 11:15 AM

A fast template engine for PHP.




This is a GrokNews Entry: (what is grok?)





Similar Items

Smarty-Light 2.2.1

Grok Headline matches for Smarty-Light 2.2.1

Smarty-Light


Smarty-Light 07/14/2004 08:42 PM
One Year Anniversary, Version 2.1.1

Light-emitting diodes, or LEDS, look set
to replace light bulbs


Light-emitting diodes, or LEDS, look set
to replace light bulbs
04/18/2005 08:41 AM
Canadian Press via Canada.com Apr 18 2005 12:09PM GMT

Red Light For Green Light Gadget


Red Light For Green Light Gadget 11/05/2003 08:39 AM
CBS News Nov 5 2003 8:19AM ET

Which one do you want? Light or Dark?
Light...but uhm...*Jen attacks*


Which one do you want? Light or Dark?
Light...but uhm...*Jen attacks*
02/14/2004 05:27 PM
Jen tried to shove a chocolate down my throat. LOL...she made a good attempt. Keyword being attempt and she wasn't...

Say it Ain't So, Smarty


Say it Ain't So, Smarty 06/07/2004 12:09 PM
Belmont Stakes turned out impressive results, despite the outcome.

If you've got experience with PHP and
Smarty under ...


If you've got experience with PHP and
Smarty under ...
12/31/2003 07:23 PM


If you've got experience with PHP and Smarty under OS X, I' m having a problem with if()s in the compiled templates. Any suggestions?


Codewalkers: Getting Into Smarty


Codewalkers: Getting Into Smarty 12/29/2003 10:59 AM
Once most coders get into the more advances realm of PHP development, they quickly realize that they're going to need some kind of simple system to template the pages of their site. Enter the Smarty template system. And, to get you started with this popular templating engine, Codewalkers.com has a new tutorial to help.

Smarty Quotes


Smarty Quotes 03/11/2003 09:43 AM
Nelson Minar rages against the dying of design, in his summary of a discussion with Cory Doctorow around using smart quotes and other typographic niceties in weblogs.
I want to use fancy Unicode characters like U+201C and U+201D ("smart quotes") in my blog. Cory hates that idea because non-ASCII characters behave badly when you paste them into your email or text editor and that they don't work well in RSS.

The underlying problem is an impedence mismatch between new Unicode oriented tech like the Web and XML and old ASCII oriented tech like email and text editors. Browsers and RSS readers should mediate between the two but software often gets it wrong.
This discussion continues a conversation on the SmartyPants plug-in I hacked together for Blosxom.

While compromising design for the sake of compensation for badly integrated technologies and encodings is not on in my book, some allowance must be made for the simple copy-n-paste. To that end, I've added a plainlink (txt) to my template alongside the permalink. This link leads to an utterly plain text (non-smarty) version of the story at hand.

Smarty for Beginners


Smarty for Beginners 12/28/2003 11:50 PM
Join Hermawan as he shows you the basic of the Smarty templating system.

Using Smarty: RSS For Every Page


Using Smarty: RSS For Every Page 10/29/2003 01:14 AM
Since all the entry data is stored in a PHP file anyway, and it is parsed out into one form already (XHTML) I figured “What the hell? Why not?” Add ”?rss” to any page on this site for the corresponding...

Smarty as a "Sub-Language"


Smarty as a "Sub-Language" 03/22/2005 04:31 PM

I've been spending some time working with Smarty lately. This is ostensibly a "templating language" for PHP. But I think it goes beyond that. I assert that Smarty has become a sub-language all by itself.

(Update: I thought of a much better name for this: "sand-boxed PHP." That's what Smarty is — a sandbox into which you can release as much or as little PHP functionality as you want.)

First of all, for the record, Smarty is astonishingly well-done. Joe tried to get me to use it for about a year, and I resisted because I've hated most templating languages I had worked with. (Lately, Joe is bugging me to try Rails, so I'm sure I'll do that about a year from now. I'm usually about a year behind Joe.)

I've spent just two weeks or so with Smarty, and I'll never, ever go back. It's one of those rare things that was written the way you would have written it if you had all the time in the world and were a lot smarter than you actually are.

What I love about Smarty is the extensibility. You can take any logic and wrap it up into a function or a modifier and expose it to Smarty, so it can be used in templates. Anything — if you can write it in PHP, you can reduce and simplify it down to a tag in Smarty.

This means that you could essentially write a new programming language in Smarty — a language that runs within PHP. Smarty already includes v ariables, flow control, several built-in modifier s and functions, and an i nclude system that's essentially a way to create user-defined functions.

Once you start wrapping up some advanced functionality into Smarty tags, you could create an entire language, teach your template developers how to use it, and they'd never know they were actually using PHP unless you told them. They'd essentially be "programming" in a sub-language that runs inside of PHP. (If they ever ask you what language you're teaching them, just string three letters together — "RTI" or "DBN" or something. They'll buy it.)

Let's consider ColdFusion, which is the language we would come the closest to if we pushed Smarty as far as it could go. This code in ColdFusion pulls a recordset, loops through it, and prints everything out.

<cfquery name="news" datasource="news">
  SELECT * FROM news
</cfquery>

<cfoutput query="news">
  #news.title#
  <br>
</cfoutput>

Now, here's the same thing in a Smarty template:

{query name="news"}
  SELECT * FROM news
{/query}

{foreach from=$news item=article}
  {$article.title}
  <br>
{/foreach}

All this took was a custom, 10-line blo ck function (written like this) that allows the template author to provide the SQL statement to be executed and returns a two-dimensional array. (Before you send the hate mail, yes I know this is wrong. I know this is a perversion of everything Smarty is supposed to do. I'm just trying to make a point here.)

So Smarty can be made to function very much like ColdFusion. It's not hard to take this further. Assign the $_GET and $_POST variables, and you can provide some dynamic functionality. This assignment:

$smarty->assign('_get', $_GET);

Will let you do this in the above template:

{query name="news"}
  SELECT * FROM news WHERE title LIKE '%{$_get.q}%'
{/query}

Now template authors can create a mini-app that searches a database table. It's not hard to see how you could make scripts to let them update tables as well.

But, you may say, Smarty has to be invoked from a PHP page, so the templates cannot be URL-addressable. True, but you can automate this. You can just route all incoming requests to the same PHP page, like this:

AliasMatch ^.*$ /template_loader.php

Then, in that file, do something like this:

$smarty->display($_SERVER['REQUEST_URI']);

This will load whatever template was called in the (fake) URL. So now template authors can start stringing templates together. Before you know it, they've gone and built a simple app. By themselves. Without you. In a language that you gave them. That runs inside of — and is essentially controlled by — PHP.

Your programming environment has now been split into a "main" language and a "sub" language, both of which you have control over. You can give your template authors as much or as little functionality as you want (you "wrote" the language, remember). They can solve as many problems as they can with what you've given them. For other problems, you can tackle them in "real" PHP and just provide the result, or you can encapsulate the algorithm and expose it to Smarty via a function or modifer.

Is this a good thing? I can't decide. But it sure is interesting, ain't it?


Smarty has a Wiki


Smarty has a Wiki 07/15/2002 01:36 PM
This Wiki is provided to allow the Smarty community (in particular members of the smarty-general mailing list) somewhere to help contribute documentation to the Smarty project. This can include tips, howtos, addons, or answers to frequently asked questions. Useful content added to the Wiki can then be rolled in to the official Smarty documentation later on.

There has been some criticism that the Smarty documentation is more useful to experienced developers than to template designers and end users. This Wiki is here to help change that.

"tri" Smarty is a popular PHP template engine that allows you to separate your code and data. A Wiki is an amazing editing and HTML generation system.

"zeldman.54"

Mr. Smarty Pants


Mr. Smarty Pants 02/18/2004 12:04 PM
It's common for pregnant women to dream they've given birth to an animal. According to a report by the New York Post, Winston Churchill's parrot is still alive. Charlie, a 104-year-old blue and gold female macaw, lives in southeast England and likes to curse Hitler. In the first century, Pliny the Elder claimed that mustard would improve lazy housewives. All of these "facts" and more can be found in the Mr. Smarty Pants Archive.

Smarty pants!


Smarty pants! 05/14/2004 01:26 PM
Where do you live, among a bastion of geeks, or sea of academia-phobes? US Census released the smartest cities, states, and counties with Seattle and Raleigh topping the cities. Also for those who are politically curious, of the top 15 states with Bachelor degrees 11 went to Gore, while 13 of the bottom 15 went to Bush.

Smarty PHP template engine 2.6.0


Smarty PHP template engine 2.6.0 11/19/2003 08:05 PM
The PHP compiling template engine.

Smarty PHP template engine 2.6.5


Smarty PHP template engine 2.6.5 09/13/2004 10:25 PM
The PHP compiling template engine.

Somewhere Smarty Jones Is Crying


Somewhere Smarty Jones Is Crying 06/13/2004 01:30 PM
Man Beats Horse, wins 25,000 pounds. For the first time, two legs triumphed over four in the annual Man Versus Horse Marathon in Wales.

Smarty PHP template engine 2.6.3


Smarty PHP template engine 2.6.3 06/17/2004 12:15 AM
The PHP compiling template engine.

Templates and You: An Intro to Smarty


Templates and You: An Intro to Smarty 07/24/2002 07:58 AM

All About Smarty - The PHP Template
Engine


All About Smarty - The PHP Template
Engine
07/25/2002 01:32 AM
WebmasterBase Jul 25 2002 0:48AM ET

DotGeek.org: PHP Templates? Get Smarty!


DotGeek.org: PHP Templates? Get Smarty! 02/17/2004 10:34 AM
From DotGeek.org this morning, there's a new tutorial for anyone out there looking to get into using PHP and the Smarty Templates for templating your site.

SmartBee - the Smarty Framework


SmartBee - the Smarty Framework 06/16/2004 06:57 AM
first pre alpha version relased

Zend: Getting Smart with Smarty


Zend: Getting Smart with Smarty 03/19/2003 10:24 PM
If you've been working on a site, and the pages are starting to get a bit out of hand as far as templating, there's plenty of systems out there that can help you get things back under control. Thanks to Zend, you can get started with Smarty and tame that site.

All eyes on Smarty Jones at Belmont


All eyes on Smarty Jones at Belmont 06/04/2004 02:05 PM

Smarty Purl Parameter Plugins 1.1


Smarty Purl Parameter Plugins 1.1 12/19/2003 02:34 PM
A plugin for Smarty to handle GET parameters efficiently.

Smarty Jones Goes for Triple Crown (AP)


Smarty Jones Goes for Triple Crown (AP) 06/05/2004 02:43 AM
AP - Smarty Jones already has proven he can run successfully in the mud. Good thing because there was a 60 percent chance of showers by post time Saturday for the Belmont Stakes.

Smarty Jones Arrives at Belmont


Smarty Jones Arrives at Belmont 06/02/2004 07:49 PM
The undefeated Smarty Jones finally arrived at Belmont, just after the little red chestnut colt was made the 2-5 morning-line favorite to defeat eight rivals.

Smarty PHP template engine 2.2.0
released


Smarty PHP template engine 2.2.0
released
07/11/2002 03:28 PM
Smarty is a template engine for PHP. Many other template engines for PHP provide basic variable substitution and dynamic block functionality. Smarty takes a step further to be a "smart" template engine, adding features such as configuration files, template functions, and variable modifiers, and making all of this functionality as easy as possible to use for both programmers and template designers. Smarty also converts the templates into PHP scripts, eliminating the need to parse the templates on every invocation. This makes Smarty extremely scalable and managable for large application needs.

Smarty Jones Chills Before the Preakness
(AP)


Smarty Jones Chills Before the Preakness
(AP)
05/15/2004 02:37 PM
AP - Six hours before the Preakness, Smarty Jones was chilling in Stall 40 of the stakes barn at Pimlico. Under the watchful eye of security guard Patricia Williams, the Kentucky Derby winner poked his head out of the stall to absorb the wind generated by the large portable fan positioned directly in front of him.

Introduction to Smarty - The PHP
Template Engine


Introduction to Smarty - The PHP
Template Engine
07/23/2002 09:41 PM
If you're a newcomer to template compilation, or Smarty, the PHP template engine, this article's a must-read! Chu Yeow explains all - from the ground-up.

Introducing Smarty: A PHP Template
Engine


Introducing Smarty: A PHP Template
Engine
09/06/2002 03:35 AM
It is quite common for PHP developers to include other files in an effort to reuse code, however templates make that job easier and allow you to separate HMTL layout from code logic.

Templates for the Masses: An Intro to
Smarty


Templates for the Masses: An Intro to
Smarty
09/06/2002 09:09 AM

Smarty in Public: an OSCON2002
Presentation


Smarty in Public: an OSCON2002
Presentation
08/07/2002 08:25 AM

onlamp: Introducing Smarty: A PHP
Template Engine


onlamp: Introducing Smarty: A PHP
Template Engine
09/08/2002 11:50 AM
While that process is certainly valid and useful, most developers agree that the separation of business logic and layout logic makes the code a lot easier to understand and maintain. This is the reason behind templates, to separate business logic from layout.

Smarty is a somewhat new development in the PHP world, and it brings several new and unique features. One of these unique features is that Smarty 'compiles' the parsed templates into PHP scripts, and then reuses the compiled template when appropriate. Obviously, this brings a huge performance improvement over other template solutions, as the main PHP script doesn't need to parse and output the same template on every request.

"zeldman.nach"

Smarty Jones All Set for Triple Crown
Tilt


Smarty Jones All Set for Triple Crown
Tilt
06/05/2004 04:48 PM
Reuters via Wired News Jun 5 2004 7:40PM GMT

Trainer: Smarty Jones 'Ready to Roll'
(AP)


Trainer: Smarty Jones 'Ready to Roll'
(AP)
05/15/2004 10:03 AM
AP - Smarty Jones has done absolutely nothing to make trainer John Servis believe the Preakness will be any different from the Kentucky Derby. "For anyone to beat him," Servis said Friday, "they will really have to run. While I haven't let him do that much the last two weeks, I have seen enough to know he's ready to roll."

Injury Forces Smarty Jones to Retire
(AP)


Injury Forces Smarty Jones to Retire
(AP)
08/02/2004 03:51 PM
AP - Smarty Jones' racing career is over. The 3-year-old red chestnut colt whose bid for thoroughbred racing's Triple Crown came up one length short in the Belmont Stakes was retired Monday because of chronic bruising in his hoofs. "It's tough," trainer John Servis said. "We had a great ride with him. It seemed there was no bottom to him. We made the decision in the best interests of the horse."

Smarty Jones Proves Superior in the
Preakness


Smarty Jones Proves Superior in the
Preakness
05/16/2004 12:36 AM
Smarty Jones did not just win the Preakness. He ran away with it and is now just a victory away from becoming the 12th winner of racing's Triple Crown.

Smarty Jones Sets Record in Preakness
Win (AP)


Smarty Jones Sets Record in Preakness
Win (AP)
05/15/2004 09:47 PM
AP - Smarty Jones blazed into the lead turning for home and won the Preakness by a record 11 1/2 lengths on Saturday, setting the stage for a dramatic Triple Crown try at the Belmont Stakes in three weeks.
Grok Description matches for Smarty-Light 2.2.1
GrokA matches for Smarty-Light 2.2.1

Smarty-Light 2.2.1

The following phrases have been identified by the grok system as matching this entry:

















Also check out:


Grok

Ipod Porn on the
Rise

Brief Abstract of
Wikipedia's
Mesothelioma Cancer
page

Get first aid
instructions in your
cell phone

IE is crap
JSPWiki gains
podcasting support

Stabilizer 0.2.1
TOAD C++ GUI Library
2004-08-04
(Development)

BWstat 0.23
Six 0.5.2
svk 0.18
LiVES 0.9.1-pre4
(Development)

PyTone 2.1.0
JavaGroups
gNaXEL Graphical XML
Editor

PureNuke
Sony VAIO PCG-GT
Project

Intel wants
broadcasters to
share the airwaves

SCO eyes
iTunes-style
software marketplace

Opus Pro 04
A good way to take
control of your
computer

Singapore holds
computer hacking
contest to find
city-state's top
code cracker

Colleges Selling
Leftovers on EBay

Manhunt game selling
out

New SuSE enterprise
Linux pips Red Hat

Google and Yahoo
criticised over
censorship in China

UPDATE 3-NTL boasts
Internet customer
gains but shares
sink

AOL snaps up
antispam company

Pilot Is Expected to
Plead Guilty in S.I.
Ferry Crash

Tales of torture
Apple's
Control-Freak
Tendencies Could
Crush iPod

'Apple's
control-freak
tendencies could
crush iPod'

Apple iPod mini now
available in India

Apple, E-Data reach
settlement in Europe

Back-to-front art; a
concept too far?
(Reuters)

Traditional Beer
Claims Comeback as
Tastes Change
(Reuters)

New Vatican Office
to Put Soul Back
Into Sports
(Reuters)

Thieves Plunder 3
Tons of Toxic
Peppers (Reuters)

Fortune-Tellers Safe
from Police
Crackdown (Reuters)

Breast Implant Ads
to Debut on Makeover
Show (Reuters)

Man Kills Wife in
Chainsaw Accident
(Reuters)

We All Scream for
Ice Cream (Reuters)

Dvorak's best of the
worst laptops

Stoned in South
Africa?

Body Electric
When pet piranha
attack

M-Audio introduces
Revolution 5.1 audio
card

Toshiba announces
60GB, 1.8-inch
hard-disk drive

iPhoto 4.0.2 update
pulled

3G Launch
Strategies: Critical
Decisions on
Services and
Technology

Telstra steals 3G
march in $450m deal

Other News:
Microsoft Voucher
Settlement

Other News: Abusing
Google

Other News: Spammer
Story

Other News: IBM
Contributes Database

Other News: Maine
Misses

what is grok?