index.php 1013 B

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