Smarty:テンプレートのコンパイルファイルを破棄する
// 指定したテンプレートのコンパイルファイルを破棄する
$smarty->clear_compiled_tpl(”index.tpl”);
// コンパイルディレクトリの中身を全て破棄する
$smarty->clear_compiled_tpl();
トラックバック URL :
コメント (0)// 指定したテンプレートのコンパイルファイルを破棄する
$smarty->clear_compiled_tpl(”index.tpl”);
// コンパイルディレクトリの中身を全て破棄する
$smarty->clear_compiled_tpl();
トラックバック URL :
コメント (0)//Smarty用テンプレートがShiftJISでも使えるようにする。
$smarty->register_prefilter(”convert_encoding_to_eucjp”);
$smarty->register_postfilter(”convert_encoding_to_sjis”);
//Smarty用SJIS文字化け対策
function convert_encoding_to_eucjp($template_source, &$smart) {
if (function_exists(”mb_convert_encoding”)) {
$enc = mb_detect_encoding($template_source, “auto”);
if ($enc != “EUC-JP”) {
return mb_convert_encoding($template_source, “EUC-JP”, $enc);
}
}
return $template_source;
}
function convert_encoding_to_sjis($template_source, &$smart) {
if (function_exists(”mb_convert_encoding”)) {
return mb_convert_encoding($template_source, “SJIS”, “EUC-JP”);
}
return $template_source;
}
トラックバック URL :
コメント (0)Copyright (C) 2007 tiny-p. All Rights Reserved.