php forum
php mysql forum
php mysql smarty
 
Topic Options
#286297 - 06/06/06 08:20 PM Smarty Templates
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25366
Loc: Texas
For everyone, they're coming and fast - I've found a nice little crash course for smarty from the good folks at php.net:<br /><br />http://smarty.php.net/crashcourse.php<br /><br />The full documentation can be found here: http://smarty.php.net/manual/en/<br /><br />"Why use it?<br /><br />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. <br /><br />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. <br /><br />This paradigm serves several purposes: <br /><br />*) 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. <br /><br />*) Errors in the templates are confined to the Smartys error handling routines, making them as simple and intuitive as possible for the designer. <br /><br />*) With presentation on its own layer, designers can modify or completely redesign it from scratch, all without intervention from the programmer. <br /><br />*) 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. <br /><br />*) 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. <br /><br />*) 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."<br /><br />There's a full library of plug-ins available here:<br /><br />http://smarty.incutio.com/?page=SmartyPlugins<br /><br /> thumbsup
_________________________
- Allen wavey
- What Drives You?

Top


Top Posters Last 30 Days
AllenAyres 83
Gizmo 29
sirdude 25
Zarzal 23
blaaskaak 12
swebs 6
willing 5
Who's Online
2 Registered (Djuma, Gizmo), 47 Guests and 11 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
User Authentication Class
by sirdude
54 minutes 29 seconds ago
Multiple Identity Detector
by Myke
Today at 05:45 AM
FlashChat with UBB.Threads 7.0.2
by Gizmo
Today at 12:30 AM
Nice Ajax Chat
by Thelockman
07/06/08 09:07 AM
[7.x] UBB.Post Templates v0.1
by sirdude
07/05/08 12:48 PM
Team UBBDev Rides Again!
by AllenAyres
07/04/08 10:56 PM
[7.3.x] ubb.links
by AllenAyres
07/03/08 06:15 PM
New Mods
Protect users emails
by Basil Fawlty
06/29/08 08:44 AM
[7.3.x] Scheduled board close for backup
by blaaskaak
06/26/08 04:01 AM
[7.3+] CustomTag - Audo Embedding
by Gizmo
06/24/08 07:52 PM
[7.3.x] ubb.links
by AllenAyres
06/20/08 11:50 PM
[7.3] Dissallow quotes more then 3 levels deep
by blaaskaak
06/09/08 09:01 AM
Newest Members
nunny, lpzie, DoubleDutch, ryzilla, M4D
13305 Registered Users

 

 

 
fusionbb message board php hacks