[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 3 /** 4 * 5 * Tests display() issues 6 * 7 * @version $Id: 2_display.php 18360 2005-05-26 19:38:09Z mipmip $ 8 * 9 */ 10 11 error_reporting(E_ALL); 12 13 require_once 'Savant2.php'; 14 15 $conf = array( 16 'template_path' => 'templates', 17 'resource_path' => 'resources' 18 ); 19 20 $savant =& new Savant2($conf); 21 22 $array = array( 23 'key0' => 'val0', 24 'key1' => 'val1', 25 'key2' => 'val2', 26 ); 27 28 $var1 = 'variable1'; 29 $var2 = 'variable2'; 30 $var3 = 'variable3'; 31 32 $ref1 = 'reference1'; 33 $ref2 = 'reference2'; 34 $ref3 = 'reference3'; 35 36 // assign vars 37 $savant->assign($var1, $var1); 38 $savant->assign($var2, $var2); 39 $savant->assign($var3, $var3); 40 41 // assigns $array to a variable $set 42 $savant->assign('set', $array); 43 44 // assigns the keys and values of array 45 $savant->assign($array); 46 47 // assign references 48 $savant->assignRef($ref1, $ref1); 49 $savant->assignRef($ref2, $ref2); 50 $savant->assignRef($ref3, $ref3); 51 52 53 echo "<h1>Display non-existent template</h1>"; 54 $result = $savant->display('no_such_template.tpl.php'); 55 echo "result: <pre>"; 56 print_r($result); 57 echo "</pre>"; 58 59 echo "<h1>Storage</h1>"; 60 echo "properties: <pre>"; 61 print_r(get_object_vars($savant)); 62 echo "</pre>"; 63 64 65 echo "<h1>Display existing template</h1>"; 66 $result = $savant->display('test.tpl.php'); 67 echo "result: <pre>"; 68 var_dump($result); 69 echo "</pre>"; 70 71 72 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |