resourceプラグイン
テンプレートのソースをDBに入れときたいときとか
リソースプラグイン | Smarty
Smartyで変数をテンプレートとして,fetch(display)で展開する - LAPISLAZULI HILL#diary
自分では
プラギンではストリングを化かすことにした。
何を渡すかはコントローラーでやるみたいな
<?php function smarty_resource_string_source($tpl_name, &$tpl_source, &$smarty) { if (isset($tpl_name)) { $tpl_source = $tpl_name; return true; } return false; } function smarty_resource_string_timestamp($tpl_name, &$tpl_timestamp, &$smarty) { if (isset($tpl_name)) { $tpl_timestamp = microtime(); return true; } return false; } function smarty_resource_string_secure($tpl_name, &$smarty) { return true; } function smarty_resource_string_trusted($tpl_name, &$smarty) { return; }