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