php forum
php mysql forum
php mysql smarty
 
Topic Options
#115985 - 06/06/06 09:18 PM Smarty Templates
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25419
Loc: Texas

   Smarty Templates to Del.icio.us Add to del.icio.us
  Digg Smarty Templates Digg it
For everyone, they're coming and fast - I've found a nice little crash course for smarty from the good folks at php.net:

http://smarty.php.net/crashcourse.php

The full documentation can be found here: http://smarty.php.net/manual/en/

"Why use it?

One of Smartys primary design goals is to facilitate the separation of application code from presentation. Typically, the application code contains the business logic of your application, written and maintained in PHP code. This code is maintained by programmers. The presentation is the way your content is presented to the end user, which is written and maintained in template files. The templates are maintained by template designers.

At its most basic function, the application code collects content, assigns it to the template engine and displays it. The content might be something like the headline, tagline, author and body of a newspaper article. The application code has no concern how this content will be presented in the template. The template designer is responsible for the presentation. They edit the template files, adding markup and bringing it to completion. This typically involves things like HTML tags, cascading style sheets and other tools provided by the template engine.

This paradigm serves several purposes:

*) Designers can't break application code. They can mess with the templates all they want, but the code stays intact. The code will be tighter, more secure and easier to maintain.

*) Errors in the templates are confined to the Smartys error handling routines, making them as simple and intuitive as possible for the designer.

*) With presentation on its own layer, designers can modify or completely redesign it from scratch, all without intervention from the programmer.

*) Programmers aren't messing with templates. They can go about maintaining the application code, changing the way content is acquired, making new business rules, etc. without disturbing the presentation layer.

*) Templates are a close representation of what the final output will be, which is an intuitive approach. Designers don't care how the content got to the template. If you have extraneous data in the template such as an SQL statement, this opens the risk of breaking application code by accidental deletion or alteration by the designer.

*) You are not opening your server to the execution of arbitrary PHP code. Smarty has many security features built in so designers won't breach security, whether intentional or accidental. They can only do what they are confined to in the templates."

There's a full library of plug-ins available here:

http://smarty.incutio.com/?page=SmartyPlugins

thumbsup
_________________________
- Allen wavey
- What Drives You?

Top
#115986 - 06/06/06 09:28 PM Re: Smarty Templates
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5119
Loc: Portland, OR, USA
To add to this; a lot of providers use Smarty with their programs, they are definately nice to fool with and can give you a lot to play with as well (as far as scaleability goes); various *Nuke's utilize Smarty for their implimentations as well.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top


Moderator:  Gizmo, tackaberry 
Top Posters Last 30 Days
AllenAyres 20
Gizmo 10
blaaskaak 2
S7ARBVCK 2
Iann128 1
Claus1 1
M4D 1
Who's Online
0 Registered (), 25 Guests and 7 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Security Patch released for all 7.x versions
by AllenAyres
Today at 08:00 PM
What do you use to edit the files
by AllenAyres
Today at 07:54 PM
Team UBBDev Rides Again!
by AllenAyres
Today at 07:32 PM
Here I am! Rock me like a Hurricane!
by AllenAyres
Today at 07:20 PM
BeyondCompare v3.00
by AllenAyres
Today at 07:16 PM
[7.3.1] add search to showmembers page
by AllenAyres
Today at 07:13 PM
Noob - need help, or a reality check!
by Gizmo
09/04/08 03:21 AM
New Mods
[7.3.1] add search to showmembers page
by blaaskaak
Today at 04:50 AM
Installing FlashChat with 7.3
by Paug
08/23/08 12:14 AM
[7.3.x] ubb.links
by AllenAyres
06/20/08 11:50 PM
[7.2.1] - Naked shoutbox
by sirdude
08/17/07 10:36 PM
[7.x] Generic Page Outside of forum directory
by
01/14/07 10:58 PM
Newest Members
veedubb8, twentyseven, Claus1, welcomeback1, Paug
13327 Registered Users

 

 

 
fusionbb message board php hacks