| 148 |
lars |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* Example Application
|
|
|
4 |
*
|
|
|
5 |
* @package Example-application
|
|
|
6 |
*/
|
|
|
7 |
require '../libs/Smarty.class.php';
|
|
|
8 |
$smarty = new Smarty;
|
|
|
9 |
//$smarty->force_compile = true;
|
|
|
10 |
$smarty->debugging = true;
|
|
|
11 |
$smarty->caching = true;
|
|
|
12 |
$smarty->cache_lifetime = 120;
|
|
|
13 |
$smarty->assign("Name", "Fred Irving Johnathan Bradley Peppergill", true);
|
|
|
14 |
$smarty->assign("FirstName", array("John", "Mary", "James", "Henry"));
|
|
|
15 |
$smarty->assign("LastName", array("Doe", "Smith", "Johnson", "Case"));
|
|
|
16 |
$smarty->assign(
|
|
|
17 |
"Class",
|
|
|
18 |
array(
|
|
|
19 |
array("A", "B", "C", "D"),
|
|
|
20 |
array("E", "F", "G", "H"),
|
|
|
21 |
array("I", "J", "K", "L"),
|
|
|
22 |
array("M", "N", "O", "P")
|
|
|
23 |
)
|
|
|
24 |
);
|
|
|
25 |
$smarty->assign(
|
|
|
26 |
"contacts",
|
|
|
27 |
array(
|
|
|
28 |
array("phone" => "1", "fax" => "2", "cell" => "3"),
|
|
|
29 |
array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")
|
|
|
30 |
)
|
|
|
31 |
);
|
|
|
32 |
$smarty->assign("option_values", array("NY", "NE", "KS", "IA", "OK", "TX"));
|
|
|
33 |
$smarty->assign("option_output", array("New York", "Nebraska", "Kansas", "Iowa", "Oklahoma", "Texas"));
|
|
|
34 |
$smarty->assign("option_selected", "NE");
|
|
|
35 |
$smarty->display('index.tpl');
|