| <?php require_once('../lib-common.php'); $retval = COM_siteHeader(); # (1)テンプレートクラスのインスタンスを作成 $user_templates = new Template('c:/xampp/htdocs/test'); # (2)テンプレートファイル名を設定 # set_file(ハンドル名,ファイル名) $user_templates->set_file('TMP','template.thtml'); # (3)変数の値を設定 # set_var(変数名,値) $user_templates->set_var('wao','わお'); $user_templates->set_var('waowao','わおわお'); $user_templates->set_var('waowaowao','わおわおわお'); # (4)変数のパース # parse(ターゲット変数,ハンドル名) # ハンドル名の全ての定義済み変数の値を置換して、ターゲット変数に格納 $user_templates->parse('OUTPUT','TMP'); # (5)HTML出力 # finish():HTMLを出力 # get_var(変数名) # 変数名の値を返す。 $retval .= $user_templates->finish($user_templates->get_var('OUTPUT')); $retval .= COM_siteFooter(); echo $retval; ?> |
| <h1></h1> <h2></h2> <h3></h3> |