脱smarty

60行で作るPHP用テンプレートエンジンを自分用に改良してみた。
テンプレートの更新チェック&書き換え処理(convert_template)を分離して、実行時はincludeするだけにする。

function include_template($_filename, $_context) {
    ob_start();
    extract($_context);
    include($_filename);
    header('Content-Length: ' . ob_get_length());
    ob_flush();
}

convert_templateはテンプレートを更新した時に手動実行すればOK。