|
|
Open
bool Open( [string filename], [ CACHED, [int time = not specified => default time] ] ) |
La fonction Open() sert à ouvrir le fichier template le fichier
peut avoir n'importe quelle extension (.htm, .html, .tpl, .php ... ).
Si aucun nom de fichier n'est defini, TPLN ouvriera le fichier ayant le meme nom que le script suivi de l'extension par defaut' |
<?php
// Simple opening
$TPLN->Open("my_file.html");
// or you can do
$TPLN->Open(); // will open the same name as your script + default extension
?>
<?php
// Opening with cache to 3600 seconds is 1 hour :
// if not specified TPLN use the default configuration in TPLN_Cfg.php
if ( !$TPLN ->Open("my_file",CACHED, 3600) )
{
//code to execute to generate the file
}
$TPLN->Write(); // print result
?>
|
Attention ! |
Si l'extension du fichier est php, php3, phtml, php4
alors le fichier sera executé automatiquement par le parseur php. |
|