コード例 #1
0
ファイル: index.php プロジェクト: RSamaium/Templates
<?php

require "../../templates.class.php";
$template = new Templates("tpl/");
$template->assignVars(array("POS" => "Position", "COLOR" => "red"));
for ($i = 0; $i < 5; $i++) {
    $template->assignBlockVars("tr", array("COLOR" => $i % 2 == 0));
    for ($j = 0; $j < 5; $j++) {
        $template->assignBlockVars("tr.td", array("VAL" => 'x:' . $i . ';y:' . $j));
    }
}
$template->setTemplate("index.html");
コード例 #2
0
ファイル: index.php プロジェクト: RSamaium/Templates
<?php

require "../../templates.class.php";
$template = new Templates("tpl/");
$template->assignVars(array("HELLOWORLD" => "Hello World"));
$template->setTemplate("simple.html");