Smarty templates Home

Introduction
Welcome
System requirements
Licensing details
What is the registration
Using PHPRunner
Working with projects
Templates
What are templates
Cars
Classified ads
Events
Jobs
Knowledge base
News
Paypal
Real estate
Sporting
Vacation houses
Connecting to the database
Datasource tables
SQL query page
About SQL query designer
Query Designer
SQL
Results
Charts
Creating chart and setting parameters
Chart appearance
Using SQL to shape chart data
Reports
Creating report and setting parameters
Report totals and layout
Choose pages
Login page
User login settings
Advanced security settings
User group permissions
Fields order and totals
Miscellaneous settings
Choose theme
Visual Editor
About
Toolbars
Page Elements
"View as" settings
"Edit as" settings
Validation types
Lookup wizard
Events
Output directory settings
After you are done
FTP upload
FrontPage Publishing
Advanced topics
Events
More info about events
Global events
Table events
Page life cycle overview
Predefined actions
Send a simple email
Send an email with new data
Save new data in another table
Insert a record into another table
Check to see if a specific record exists
Display a message on the Web page
Redirect to another page
Custom code
Sample events
Show list of customer orders
Check if start date is ealier than end date
Before deleting a record check for related records
Speed up data entry using events
Publishing PHP application to the remote Web server
Using FTP client to publish PHP pages to the remote Web server
Using FrontPage to publish PHP pages to the remote Web server
Demo Account
What is the Demo Account?
Terms and Conditions
Connect using PHP
Master-details relationships
Using JOIN SQL queries
AJAX-based Functionality
PHPRunner session variables
Debugging tips
Template files processing rules (Files.txt)
Multilanguage support
Useful functions and links
Smarty templates
Stylesheets
Template language
How to control Inline Add/Edit functionality from script
Rich Text Editor plugins
Upgrade Guide from PHPRunner 3.0 and older
PDF view settings
Order PHPRunner online

 
  PHPRunner manual


Smarty templates

 

Smarty is a library that allows the creation of HTML templates that are imported and used in PHPRunner scripts to ease the process of web page design. Smarty cleanly separates your presentation elements (HTML, CSS, etc.) from your application code.

Template files (*.htm) can be found in template directory inside output directory.

Here is the basic example of how Smarty works:

list.php

 
include('Smarty.class.php');

// create object
$smarty = new Smarty;

// assign some content. This would typically come from
// a database or other source, but we'll use static
// values for the purpose of this example.
$smarty->assign('name', 'george smith');
$smarty->assign('address', '45th & Harris');

// display it
$smarty->display('list.htm');

The template file then contains the output interspersed with tags that Smarty replaces with assigned content.

list.htm

output

 
<html>
<head>
<title>User Info</title>
</head>
<body>

User Information:<p>

Name: {$name}<br>
Address: {$address}<br>

</body>
</html>

 

 
<html>
<head>
<title>User Info</title>
</head>
<body>

User Information:<p>

Name: george smith<br>
Address: 45th & Harris<br>

</body>
</html>

 

More info:

Official Smarty web site (documentation, examples, FAQ, wiki etc)

 

The CHM file was converted to HTML by chm2web software.